Skip to content

Upgrade TypeScript examples for aws v7-alpha #2186

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion aws-ts-airflow/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const db = new aws.rds.Instance("postgresdb", {
dbSubnetGroupName: dbSubnets.id,
vpcSecurityGroupIds: securityGroupIds,

name: "airflow",
dbName: "airflow",
username: "airflow",
password: dbPassword,

Expand Down Expand Up @@ -138,3 +138,4 @@ const airflowWorkers = new awsx.classic.ecs.EC2Service("airflowworkers", {

export let airflowEndpoint = airflowControllerListener.endpoint.hostname;
export let flowerEndpoint = airflowerListener.endpoint.hostname;

4 changes: 2 additions & 2 deletions aws-ts-airflow/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"@types/node": "22.13.14"
},
"dependencies": {
"@pulumi/aws": "6.73.0",
"@pulumi/aws": "^7.0.0-alpha.1",
"@pulumi/awsx": "2.21.1",
"@pulumi/pulumi": "3.158.0",
"typescript": "^5.0.0"
"typescript": "^5.8.3"
}
}
3 changes: 2 additions & 1 deletion aws-ts-apigateway-eventbridge/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ const stage = new aws.apigateway.Stage("stage", {

// Create a Lambda function handler with permission to log to CloudWatch.
const lambda = new aws.lambda.CallbackFunction("lambda", {
policies: [aws.iam.ManagedPolicies.CloudWatchLogsFullAccess],
policies: [aws.iam.ManagedPolicy.CloudWatchLogsFullAccess],
callback: async (event: any) => {

// For now, just log the event, including the uploaded document.
Expand All @@ -219,3 +219,4 @@ const lambdaPermission = new aws.lambda.Permission("lambda-permission", {

// Export the API Gateway URL to give us something to POST to.
export const url = stage.invokeUrl;

5 changes: 3 additions & 2 deletions aws-ts-apigateway-eventbridge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
"@types/node": "22.13.14"
},
"dependencies": {
"@pulumi/aws": "^7.0.0-alpha.1",
"@pulumi/awsx": "2.21.1",
"@pulumi/pulumi": "3.158.0",
"@pulumi/aws": "6.73.0",
"@pulumi/awsx": "2.21.1"
"typescript": "^5.8.3"
}
}
9 changes: 6 additions & 3 deletions aws-ts-apigateway-lambda-serverless/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import handler from "./handler";
// Create Lambda functions for our API
const handlerFunction = new aws.lambda.CallbackFunction("get-handler", {
callback: handler,
runtime: aws.lambda.Runtime.NodeJS18X,
runtime: aws.lambda.Runtime.NodeJS18dX,
});

const postHandlerFunction = new aws.lambda.CallbackFunction("post-handler", {
Expand All @@ -25,7 +25,7 @@ const postHandlerFunction = new aws.lambda.CallbackFunction("post-handler", {
body: JSON.stringify({ message: "POST successful" }),
};
},
runtime: aws.lambda.Runtime.NodeJS18X,
runtime: aws.lambda.Runtime.NodeJS18dX,
});

const deleteHandlerFunction = new aws.lambda.CallbackFunction("delete-handler", {
Expand All @@ -36,7 +36,7 @@ const deleteHandlerFunction = new aws.lambda.CallbackFunction("delete-handler",
body: JSON.stringify({ message: "DELETE successful" }),
};
},
runtime: aws.lambda.Runtime.NodeJS18X,
runtime: aws.lambda.Runtime.NodeJS18dX,
});

// Create an API endpoint.
Expand Down Expand Up @@ -64,3 +64,6 @@ const endpoint = new apigateway.RestAPI("hello-world", {
// Pulumi exports values
// See these outputs using: pulumi stack output endpointUrl
export const endpointUrl = endpoint.url;



5 changes: 3 additions & 2 deletions aws-ts-apigateway-lambda-serverless/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
"@types/node": "22.13.14"
},
"dependencies": {
"@pulumi/aws": "6.73.0",
"@pulumi/aws": "^7.0.0-alpha.1",
"@pulumi/aws-apigateway": "2.6.2",
"@pulumi/awsx": "2.21.1",
"@pulumi/pulumi": "3.158.0"
"@pulumi/pulumi": "3.158.0",
"typescript": "^5.8.3"
}
}
2 changes: 1 addition & 1 deletion aws-ts-apigatewayv2-eventbridge/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const route = new aws.apigatewayv2.Route("route", {

// Create a Lambda function handler with permission to log to CloudWatch.
const lambda = new aws.lambda.CallbackFunction("lambda", {
policies: [aws.iam.ManagedPolicies.CloudWatchLogsFullAccess],
policies: [aws.iam.ManagedPolicy.CloudWatchLogsFullAccess],
callback: async (event: any) => {

// For now, just log the event, including the uploaded document.
Expand Down
5 changes: 3 additions & 2 deletions aws-ts-apigatewayv2-eventbridge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
"@types/node": "22.13.14"
},
"dependencies": {
"@pulumi/aws": "^7.0.0-alpha.1",
"@pulumi/awsx": "2.21.1",
"@pulumi/pulumi": "3.158.0",
"@pulumi/aws": "6.73.0",
"@pulumi/awsx": "2.21.1"
"typescript": "^5.8.3"
}
}
6 changes: 3 additions & 3 deletions aws-ts-assume-role/assume-role/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ const config = new pulumi.Config();
const roleToAssumeARN = config.require("roleToAssumeARN");

const provider = new aws.Provider("privileged", {
assumeRole: {
assumeRoles: [{
roleArn: roleToAssumeARN,
sessionName: "PulumiSession",
externalId: "PulumiApplication",
},
}],
region: aws.config.requireRegion(),
});

// Create an AWS resource (S3 Bucket)
const bucket = new aws.s3.BucketV2("my-bucket", {}, {provider: provider});
const bucket = new aws.s3.Bucket("my-bucket", {}, {provider: provider});

// Export the DNS name of the bucket
export const bucketName = bucket.bucketDomainName;
5 changes: 3 additions & 2 deletions aws-ts-assume-role/assume-role/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"@types/node": "22.13.14"
},
"dependencies": {
"@pulumi/aws": "6.73.0",
"@pulumi/pulumi": "3.158.0"
"@pulumi/aws": "^7.0.0-alpha.1",
"@pulumi/pulumi": "3.158.0",
"typescript": "^5.8.3"
}
}
2 changes: 1 addition & 1 deletion aws-ts-containers-dockerbuild/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "aws-ts-containers-dockerbuildcloud",
"main": "index.ts",
"dependencies": {
"@pulumi/aws": "6.73.0",
"@pulumi/aws": "^7.0.0-alpha.1",
"@pulumi/awsx": "2.21.1",
"@pulumi/docker-build": "0.0.10",
"@pulumi/pulumi": "3.158.0"
Expand Down
19 changes: 19 additions & 0 deletions aws-ts-containers-dockerbuild/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"compilerOptions": {
"outDir": "bin",
"target": "es2016",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"experimentalDecorators": true,
"pretty": true,
"noFallthroughCasesInSwitch": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"forceConsistentCasingInFileNames": true,
"strictNullChecks": true
},
"files": [
"index.ts"
]
}
2 changes: 1 addition & 1 deletion aws-ts-containers-dockerbuildcloud/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "aws-ts-containers-dockerbuildcloud",
"main": "index.ts",
"dependencies": {
"@pulumi/aws": "6.73.0",
"@pulumi/aws": "^7.0.0-alpha.1",
"@pulumi/awsx": "2.21.1",
"@pulumi/docker-build": "0.0.10",
"@pulumi/pulumi": "3.158.0"
Expand Down
19 changes: 19 additions & 0 deletions aws-ts-containers-dockerbuildcloud/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"compilerOptions": {
"outDir": "bin",
"target": "es2016",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"experimentalDecorators": true,
"pretty": true,
"noFallthroughCasesInSwitch": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"forceConsistentCasingInFileNames": true,
"strictNullChecks": true
},
"files": [
"index.ts"
]
}
2 changes: 1 addition & 1 deletion aws-ts-containers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "aws-ts-containers",
"main": "index.js",
"dependencies": {
"@pulumi/aws": "6.73.0",
"@pulumi/aws": "^7.0.0-alpha.1",
"@pulumi/awsx": "2.21.1",
"@pulumi/pulumi": "3.158.0"
},
Expand Down
19 changes: 19 additions & 0 deletions aws-ts-containers/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"compilerOptions": {
"outDir": "bin",
"target": "es2016",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"experimentalDecorators": true,
"pretty": true,
"noFallthroughCasesInSwitch": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"forceConsistentCasingInFileNames": true,
"strictNullChecks": true
},
"files": [
"index.ts"
]
}
1 change: 0 additions & 1 deletion aws-ts-k8s-mern-voting-app/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ const eksCluster = new eks.Cluster("eksCluster", {
desiredCapacity: 3,
minSize: 2,
maxSize: 4,
deployDashboard: false,
enabledClusterLogTypes: [
"api",
"audit",
Expand Down
4 changes: 2 additions & 2 deletions aws-ts-k8s-mern-voting-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"version": "0.1.0",
"devDependencies": {
"@types/node": "22.13.14",
"typescript": "5.8.2"
"typescript": "^5.8.2"
},
"dependencies": {
"@pulumi/aws": "6.73.0",
"@pulumi/aws": "^7.0.0-alpha.1",
"@pulumi/awsx": "2.21.1",
"@pulumi/eks": "3.8.1",
"@pulumi/pulumi": "3.158.0"
Expand Down
1 change: 0 additions & 1 deletion aws-ts-k8s-voting-app/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ const eksCluster = new eks.Cluster("eksCluster", {
desiredCapacity: 3,
minSize: 2,
maxSize: 4,
deployDashboard: false,
enabledClusterLogTypes: [
"api",
"audit",
Expand Down
4 changes: 2 additions & 2 deletions aws-ts-k8s-voting-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"version": "0.1.0",
"devDependencies": {
"@types/node": "22.13.14",
"typescript": "5.8.2"
"typescript": "^5.8.2"
},
"dependencies": {
"@pulumi/aws": "6.73.0",
"@pulumi/aws": "^7.0.0-alpha.1",
"@pulumi/awsx": "2.21.1",
"@pulumi/eks": "3.8.1",
"@pulumi/postgresql": "3.15.1",
Expand Down
2 changes: 1 addition & 1 deletion aws-ts-lambda-secrets/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface LambdaConfig {
const config = new pulumi.Config();
const lambdaconfig = config.requireObject<LambdaConfig>("lambdawithsecrets");

const secretsArnArray: pulumi.Output<string>[] = new Array();
const secretsArnArray: Record<string, pulumi.Output<string>> = {};
const secretArray: aws.secretsmanager.Secret[] = new Array();
for (const key in lambdaconfig.secrets) {
if (lambdaconfig.secrets.hasOwnProperty(key)) {
Expand Down
3 changes: 2 additions & 1 deletion aws-ts-lambda-secrets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"@types/node": "22.13.14"
},
"dependencies": {
"@pulumi/aws": "^7.0.0-alpha.1",
"@pulumi/pulumi": "^3.0.0",
"@pulumi/aws": "^6.0.0"
"typescript": "^5.8.3"
}
}
1 change: 0 additions & 1 deletion aws-ts-lambda-secrets/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"forceConsistentCasingInFileNames": true,
"suppressImplicitAnyIndexErrors": true
},
"files": [
"index.ts"
Expand Down
12 changes: 9 additions & 3 deletions aws-ts-lambda-slack/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const lambdaRole = new aws.iam.Role("lambdaRole", {
// Attach a policy to the role to allow Lambda to log to CloudWatch
const rpa = new aws.iam.RolePolicyAttachment("lambdaRolePolicy", {
role: lambdaRole.name,
policyArn: aws.iam.ManagedPolicies.AWSLambdaBasicExecutionRole,
policyArn: aws.iam.ManagedPolicy.AWSLambdaBasicExecutionRole,
});

// Create the Lambda function
Expand Down Expand Up @@ -89,8 +89,14 @@ const lambdaPermission = new aws.lambda.Permission("apiGatewayPermission", {
// Deploy the API
const deployment = new aws.apigateway.Deployment("myDeployment", {
restApi: api.id,
stageName: "dev",
}, { dependsOn: [rootIntegration] });

// Create explicit stage
const stage = new aws.apigateway.Stage("dev", {
stageName: "dev",
restApi: api.id,
deployment: deployment.id,
});

// Export the URL of the API
export const url = pulumi.interpolate`${deployment.invokeUrl}`;
export const url = stage.invokeUrl;
4 changes: 2 additions & 2 deletions aws-ts-lambda-slack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"main": "index.ts",
"devDependencies": {
"@types/node": "22.13.14",
"typescript": "5.8.2"
"typescript": "^5.8.2"
},
"dependencies": {
"@pulumi/aws": "6.73.0",
"@pulumi/aws": "^7.0.0-alpha.1",
"@pulumi/pulumi": "3.158.0"
}
}
2 changes: 1 addition & 1 deletion aws-ts-lambda-thumbnailer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"main": "index.js",
"dependencies": {
"@pulumi/aws": "6.73.0",
"@pulumi/aws": "^7.0.0-alpha.1",
"@pulumi/awsx": "2.21.1",
"@pulumi/pulumi": "3.158.0"
}
Expand Down
19 changes: 19 additions & 0 deletions aws-ts-lambda-thumbnailer/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"compilerOptions": {
"outDir": "bin",
"target": "es2016",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"experimentalDecorators": true,
"pretty": true,
"noFallthroughCasesInSwitch": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"forceConsistentCasingInFileNames": true,
"strictNullChecks": true
},
"files": [
"index.ts"
]
}
2 changes: 1 addition & 1 deletion aws-ts-multi-language-lambda/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export = async () => {
const role = new aws.iam.Role("lambdarole", {
assumeRolePolicy: aws.iam.assumeRolePolicyForPrincipal(aws.iam.Principals.LambdaPrincipal),
managedPolicyArns: [
aws.iam.ManagedPolicies.AWSLambdaBasicExecutionRole,
aws.iam.ManagedPolicy.AWSLambdaBasicExecutionRole,
],
});

Expand Down
4 changes: 2 additions & 2 deletions aws-ts-multi-language-lambda/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"main": "index.ts",
"devDependencies": {
"@types/node": "22.13.14",
"typescript": "5.8.2"
"typescript": "^5.8.2"
},
"dependencies": {
"@pulumi/aws": "^6.0.0",
"@pulumi/aws": "^7.0.0-alpha.1",
"@pulumi/awsx": "^2.0.2",
"@pulumi/docker-build": "^0.0.10",
"@pulumi/pulumi": "^3.113.0"
Expand Down
Loading
Loading