Skip to content

Commit 41e6ab9

Browse files
authored
Upgrade to aws v7.0.0 (#1640)
fixes #1612
1 parent 711916e commit 41e6ab9

File tree

137 files changed

+7870
-2579
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+7870
-2579
lines changed

.ci-mgmt.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
provider: awsx
22
aws: true
3-
major-version: 2
3+
major-version: 3
44
template: generic
55

66
buildProviderCmd: "OS=$(1) ARCH=$(2) OUT=$(3) yarn --cwd awsx build"

.github/workflows/prerequisites.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
- uses: pulumi/provider-version-action@f96d032a2758fdda7939e5728eff6c0d980ae894 # v1.6.0
5959
id: provider-version
6060
with:
61-
major-version: 2
61+
major-version: 3
6262
set-env: 'PROVIDER_VERSION'
6363
- name: Cache examples generation
6464
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
PACK := awsx
44
ORG := pulumi
55
PROJECT := github.com/$(ORG)/pulumi-$(PACK)
6-
PROVIDER_PATH := provider/v2
6+
PROVIDER_PATH := provider/v3
77
VERSION_PATH := $(PROVIDER_PATH)/pkg/version.Version
88
CODEGEN := pulumi-gen-$(PACK)
99
PROVIDER := pulumi-resource-$(PACK)
@@ -17,7 +17,7 @@ PULUMI_MISSING_DOCS_ERROR := false
1717

1818
# Override during CI using `make [TARGET] PROVIDER_VERSION=""` or by setting a PROVIDER_VERSION environment variable
1919
# Local & branch builds will just used this fixed default version unless specified
20-
PROVIDER_VERSION ?= 2.0.0-alpha.0+dev
20+
PROVIDER_VERSION ?= 3.0.0-alpha.0+dev
2121

2222
# Check version doesn't start with a "v" - this is a common mistake
2323
ifeq ($(shell echo $(PROVIDER_VERSION) | cut -c1),v)

awsx-classic/apigateway/api.ts

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -631,8 +631,6 @@ export function createAPI(parent: pulumi.Resource, name: string, args: APIArgs,
631631
const deployment = new aws.apigateway.Deployment(name, {
632632
...args.deploymentArgs,
633633
restApi: restAPI,
634-
// Note: Set to empty to avoid creating an implicit stage, we'll create it explicitly below instead.
635-
stageName: "",
636634
// Note: We set `variables` here because it forces recreation of the Deployment object
637635
// whenever the body hash changes. Because we use a blank stage name above, there will
638636
// not actually be any stage created in AWS, and thus these variables will not actually
@@ -645,10 +643,7 @@ export function createAPI(parent: pulumi.Resource, name: string, args: APIArgs,
645643
dependsOn: apiPolicy ? [apiPolicy] : [],
646644
});
647645

648-
const permissions = createLambdaPermissions(parent, deployment, name, swaggerLambdas);
649-
650-
// Expose the URL that the API is served at.
651-
const url = pulumi.interpolate`${deployment.invokeUrl}${stageName}/`;
646+
const permissions = createLambdaPermissions(parent, restAPI, name, swaggerLambdas);
652647

653648
// Create a stage, which is an addressable instance of the Rest API. Set it to point at the latest deployment.
654649
const stage = new aws.apigateway.Stage(name, {
@@ -658,6 +653,9 @@ export function createAPI(parent: pulumi.Resource, name: string, args: APIArgs,
658653
stageName: stageName,
659654
}, { parent, dependsOn: permissions });
660655

656+
// Expose the URL that the API is served at.
657+
const url = pulumi.interpolate`${stage.invokeUrl}/`;
658+
661659
return {
662660
restAPI,
663661
deployment,
@@ -669,7 +667,12 @@ export function createAPI(parent: pulumi.Resource, name: string, args: APIArgs,
669667
};
670668
}
671669

672-
function createLambdaPermissions(parent: pulumi.Resource, deployment: aws.apigateway.Deployment, name: string, swaggerLambdas: SwaggerLambdas) {
670+
function createLambdaPermissions(
671+
parent: pulumi.Resource,
672+
restAPI: aws.apigateway.RestApi,
673+
name: string,
674+
swaggerLambdas: SwaggerLambdas
675+
) {
673676
const permissions: aws.lambda.Permission[] = [];
674677
for (const [path, lambdas] of swaggerLambdas) {
675678
for (const [method, lambda] of lambdas) {
@@ -683,7 +686,7 @@ function createLambdaPermissions(parent: pulumi.Resource, deployment: aws.apigat
683686
// path on the API. We allow any stage instead of encoding the one known stage that will be
684687
// deployed by Pulumi because the API Gateway console "Test" feature invokes the route
685688
// handler with the fake stage `test-invoke-stage`.
686-
sourceArn: pulumi.interpolate`${deployment.executionArn}*/${methodAndPath}`,
689+
sourceArn: pulumi.interpolate`${restAPI.executionArn}*/${methodAndPath}`,
687690
}, { parent }));
688691
}
689692
}
@@ -1084,7 +1087,7 @@ function addStaticRouteToSwaggerSpec(
10841087
}, { parent });
10851088
const attachment = new aws.iam.RolePolicyAttachment(key, {
10861089
role: role,
1087-
policyArn: aws.iam.ManagedPolicies.AmazonS3FullAccess,
1090+
policyArn: aws.iam.ManagedPolicy.AmazonS3FullAccess,
10881091
}, { parent });
10891092

10901093
return role;

awsx-classic/autoscaling/launchConfiguration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export class AutoScalingLaunchConfiguration extends pulumi.ComponentResource {
8282
}
8383

8484
public static defaultInstanceProfilePolicyARNs() {
85-
return [aws.iam.ManagedPolicies.AmazonEC2ContainerServiceforEC2Role, aws.iam.ManagedPolicies.AmazonEC2ReadOnlyAccess];
85+
return [aws.iam.ManagedPolicy.AmazonEC2ContainerServiceforEC2Role, aws.iam.ManagedPolicy.AmazonEC2ReadOnlyAccess];
8686
}
8787

8888
/**

awsx-classic/ecs/image.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -194,16 +194,11 @@ export function computeImageFromAsset(
194194
throw new Error("Expected registry ID to be defined during push");
195195
}
196196

197-
const credentials = await aws.ecr.getCredentials({ registryId: registryId }, { parent, async: true });
198-
const decodedCredentials = Buffer.from(credentials.authorizationToken, "base64").toString();
199-
const [username, password] = decodedCredentials.split(":");
200-
if (!password || !username) {
201-
throw new Error("Invalid credentials");
202-
}
197+
const credentials = await aws.ecr.getAuthorizationToken({ registryId: registryId }, { parent, async: true });
203198
return {
204199
registry: credentials.proxyEndpoint,
205-
username: username,
206-
password: password,
200+
username: credentials.userName,
201+
password: credentials.password,
207202
};
208203
});
209204

awsx-classic/ecs/taskDefinition.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ export abstract class TaskDefinition extends pulumi.ComponentResource {
158158
public static defaultExecutionRolePolicyARNs() {
159159
return [
160160
"arn:aws:iam::aws:policy/service-role/AmazonECSTaskExecutionRolePolicy",
161-
aws.iam.ManagedPolicies.AWSLambdaBasicExecutionRole,
161+
aws.iam.ManagedPolicy.AWSLambdaBasicExecutionRole,
162162
];
163163
}
164164
}
@@ -337,11 +337,6 @@ export interface TaskDefinitionArgs {
337337
*/
338338
family?: pulumi.Input<string>;
339339

340-
/**
341-
* Configuration block(s) with Inference Accelerators settings. Detailed below.
342-
*/
343-
inferenceAccelerators?: pulumi.Input<pulumi.Input<aws.types.input.ecs.TaskDefinitionInferenceAccelerator>[]>;
344-
345340
/**
346341
* The IPC resource namespace to be used for the containers in the task The valid values are `host`, `task`, and `none`.
347342
*/

awsx-classic/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
},
1515
"dependencies": {
1616
"@aws-sdk/client-ecs": "^3.405.0",
17-
"@pulumi/aws": "^6.0.2",
17+
"@pulumi/aws": "^7.0.0",
1818
"@pulumi/docker": "4.5.8",
1919
"@pulumi/pulumi": "^3.34.0",
2020
"aws-lambda": "^1.0.7",

awsx/cloudtrail/trail.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ function createBucketCloudtrailPolicy(
7272
);
7373
}
7474

75-
function defaultCloudTrailPolicy(bucketArn: string): aws.iam.PolicyDocument {
75+
function defaultCloudTrailPolicy(bucketArn: string): aws.types.input.iam.PolicyDocument {
7676
return {
7777
Version: "2012-10-17",
7878
Statement: [

awsx/ec2/vpc.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -379,9 +379,10 @@ describe("child resource api", () => {
379379
case "aws:index/getAvailabilityZones:getAvailabilityZones":
380380
const result: pulumiAws.GetAvailabilityZonesResult = {
381381
id: "mocked-az-result",
382-
zoneIds: [1, 2, 3].map((i) => `${pulumiAws.USEast1Region}${i}`),
383-
names: [1, 2, 3].map((i) => `${pulumiAws.USEast1Region}${i}`),
384-
groupNames: [1, 2, 3].map((i) => `${pulumiAws.USEast1Region}${i}`),
382+
zoneIds: [1, 2, 3].map((i) => `${pulumiAws.Region.USEast1}${i}`),
383+
names: [1, 2, 3].map((i) => `${pulumiAws.Region.USEast1}${i}`),
384+
groupNames: [1, 2, 3].map((i) => `${pulumiAws.Region.USEast1}${i}`),
385+
region: pulumiAws.Region.USEast1,
385386
};
386387
return result;
387388
default:

0 commit comments

Comments
 (0)