diff --git a/packages/@aws-cdk/aws-amplify/README.md b/packages/@aws-cdk/aws-amplify/README.md index 1ff84b938a323..516dfc7672c3f 100644 --- a/packages/@aws-cdk/aws-amplify/README.md +++ b/packages/@aws-cdk/aws-amplify/README.md @@ -231,6 +231,19 @@ const amplifyApp = new amplify.App(this, 'App', { }); ``` +## Adding Platform and Framework properties to your Amplify App + +Use the `framework` property on `BranchOptions` to pass in an optional value for the framework: + +```ts +const amplifyApp = new amplify.App(this, 'App', { + platform: amplify.Platform.WEB, +}); +amplifyApp.addBranch('feature/next', { + framework: 'ExampleFramework', +}); +``` + ## Deploying Assets `sourceCodeProvider` is optional; when this is not specified the Amplify app can be deployed to using `.zip` packages. The `asset` property can be used to deploy S3 assets to Amplify as part of the CDK: diff --git a/packages/@aws-cdk/aws-amplify/lib/app.ts b/packages/@aws-cdk/aws-amplify/lib/app.ts index 387e89110568b..6870d48265ccf 100644 --- a/packages/@aws-cdk/aws-amplify/lib/app.ts +++ b/packages/@aws-cdk/aws-amplify/lib/app.ts @@ -159,6 +159,34 @@ export interface AppProps { * @default - a new role is created */ readonly role?: iam.IRole; + + /** + * The Platform type of the Amplify application + * + * @default - no platform + */ + readonly platform?: Platform +} + +/** + * The platform type for an Amplify App. + */ +export enum Platform { + /** + * Static app (WEB) + */ + WEB = 'WEB', + + /** + * Dynamic SSR app (WEB_COMPUTE) + */ + WEB_COMPUTE = 'WEB_COMPUTE', + + /** + * App requiring Amplify hosting's original SSR support only + * (WEB_DYNAMIC) + */ + WEB_DYNAMIC = 'WEB_DYNAMIC', } /** @@ -249,6 +277,7 @@ export class App extends Resource implements IApp, iam.IGrantable { oauthToken: sourceCodeProviderOptions?.oauthToken?.unsafeUnwrap(), // Safe usage repository: sourceCodeProviderOptions?.repository, customHeaders: props.customResponseHeaders ? renderCustomResponseHeaders(props.customResponseHeaders) : undefined, + platform: props.platform, }); this.appId = app.attrAppId; diff --git a/packages/@aws-cdk/aws-amplify/lib/branch.ts b/packages/@aws-cdk/aws-amplify/lib/branch.ts index 40c1bdb3d0671..c3b0bcd7688d4 100644 --- a/packages/@aws-cdk/aws-amplify/lib/branch.ts +++ b/packages/@aws-cdk/aws-amplify/lib/branch.ts @@ -125,6 +125,13 @@ export interface BranchOptions { * @default false */ readonly performanceMode?: boolean; + + /** + * The Framework for the branch. + * + * @default - no framework + */ + readonly framework?: string; } /** @@ -180,6 +187,7 @@ export class Branch extends Resource implements IBranch { pullRequestEnvironmentName: props.pullRequestEnvironmentName, stage: props.stage, enablePerformanceMode: props.performanceMode, + framework: props.framework, }); this.arn = branch.attrArn; diff --git a/packages/@aws-cdk/aws-amplify/test/app.test.ts b/packages/@aws-cdk/aws-amplify/test/app.test.ts index d778ce133b337..f9297ac50a053 100644 --- a/packages/@aws-cdk/aws-amplify/test/app.test.ts +++ b/packages/@aws-cdk/aws-amplify/test/app.test.ts @@ -442,3 +442,19 @@ test('with custom headers', () => { }, }); }); + +test('create an amplify app with platform ', () => { + // WHEN + new amplify.App(stack, 'App', { + sourceCodeProvider: new amplify.GitHubSourceCodeProvider({ + owner: 'aws', + repository: 'aws-cdk', + oauthToken: SecretValue.unsafePlainText('secret'), + }), + platform: amplify.Platform.WEB, + }); + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::Amplify::App', { + Platform: 'WEB', + }); +}); diff --git a/packages/@aws-cdk/aws-amplify/test/branch.test.ts b/packages/@aws-cdk/aws-amplify/test/branch.test.ts index 0e5255b8d0f2b..4a61df4b975fe 100644 --- a/packages/@aws-cdk/aws-amplify/test/branch.test.ts +++ b/packages/@aws-cdk/aws-amplify/test/branch.test.ts @@ -4,141 +4,155 @@ import { Asset } from '@aws-cdk/aws-s3-assets'; import { SecretValue, Stack } from '@aws-cdk/core'; import * as amplify from '../lib'; -let stack: Stack; -let app: amplify.App; -beforeEach(() => { - stack = new Stack(); - app = new amplify.App(stack, 'App', { - sourceCodeProvider: new amplify.GitHubSourceCodeProvider({ - owner: 'aws', - repository: 'aws-cdk', - oauthToken: SecretValue.unsafePlainText('secret'), - }), +describe('amplify app', () => { + let stack: Stack; + let app: amplify.App; + beforeEach(() => { + stack = new Stack(); + app = new amplify.App(stack, 'App', { + sourceCodeProvider: new amplify.GitHubSourceCodeProvider({ + owner: 'aws', + repository: 'aws-cdk', + oauthToken: SecretValue.unsafePlainText('secret'), + }), + }); }); -}); -test('create a branch', () => { - // WHEN - app.addBranch('dev'); + test('create a branch', () => { + // WHEN + app.addBranch('dev'); - // THEN - Template.fromStack(stack).hasResourceProperties('AWS::Amplify::Branch', { - AppId: { - 'Fn::GetAtt': [ - 'AppF1B96344', - 'AppId', - ], - }, - BranchName: 'dev', - EnableAutoBuild: true, - EnablePullRequestPreview: true, + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::Amplify::Branch', { + AppId: { + 'Fn::GetAtt': [ + 'AppF1B96344', + 'AppId', + ], + }, + BranchName: 'dev', + EnableAutoBuild: true, + EnablePullRequestPreview: true, + }); }); -}); -test('with basic auth from credentials', () => { - // WHEN - app.addBranch('dev', { - basicAuth: amplify.BasicAuth.fromCredentials('username', SecretValue.unsafePlainText('password')), - }); + test('with basic auth from credentials', () => { + // WHEN + app.addBranch('dev', { + basicAuth: amplify.BasicAuth.fromCredentials('username', SecretValue.unsafePlainText('password')), + }); - // THEN - Template.fromStack(stack).hasResourceProperties('AWS::Amplify::Branch', { - BasicAuthConfig: { - EnableBasicAuth: true, - Password: 'password', - Username: 'username', - }, + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::Amplify::Branch', { + BasicAuthConfig: { + EnableBasicAuth: true, + Password: 'password', + Username: 'username', + }, + }); }); -}); -test('with basic auth from generated password', () => { - // WHEN - app.addBranch('dev', { - basicAuth: amplify.BasicAuth.fromGeneratedPassword('username'), - }); + test('with basic auth from generated password', () => { + // WHEN + app.addBranch('dev', { + basicAuth: amplify.BasicAuth.fromGeneratedPassword('username'), + }); - // THEN - Template.fromStack(stack).hasResourceProperties('AWS::Amplify::Branch', { - BasicAuthConfig: { - EnableBasicAuth: true, - Password: { - 'Fn::Join': [ - '', - [ - '{{resolve:secretsmanager:', - { - Ref: 'AppdevdevBasicAuthB25D2314', - }, - ':SecretString:password::}}', + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::Amplify::Branch', { + BasicAuthConfig: { + EnableBasicAuth: true, + Password: { + 'Fn::Join': [ + '', + [ + '{{resolve:secretsmanager:', + { + Ref: 'AppdevdevBasicAuthB25D2314', + }, + ':SecretString:password::}}', + ], ], - ], + }, + Username: 'username', }, - Username: 'username', - }, + }); }); -}); -test('with env vars', () => { - // WHEN - const branch = app.addBranch('dev', { - environmentVariables: { - key1: 'value1', - }, + test('with env vars', () => { + // WHEN + const branch = app.addBranch('dev', { + environmentVariables: { + key1: 'value1', + }, + }); + branch.addEnvironment('key2', 'value2'); + + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::Amplify::Branch', { + EnvironmentVariables: [ + { + Name: 'key1', + Value: 'value1', + }, + { + Name: 'key2', + Value: 'value2', + }, + ], + }); }); - branch.addEnvironment('key2', 'value2'); - // THEN - Template.fromStack(stack).hasResourceProperties('AWS::Amplify::Branch', { - EnvironmentVariables: [ - { - Name: 'key1', - Value: 'value1', + test('with asset deployment', () => { + // WHEN + const asset = new Asset(app, 'SampleAsset', { + path: path.join(__dirname, './test-asset'), + }); + app.addBranch('dev', { asset }); + + // THEN + Template.fromStack(stack).hasResourceProperties('Custom::AmplifyAssetDeployment', { + ServiceToken: { + 'Fn::GetAtt': [ + 'comamazonawscdkcustomresourcesamplifyassetdeploymentproviderNestedStackcomamazonawscdkcustomresourcesamplifyassetdeploymentproviderNestedStackResource89BDFEB2', + 'Outputs.comamazonawscdkcustomresourcesamplifyassetdeploymentprovideramplifyassetdeploymenthandlerproviderframeworkonEventA449D9A9Arn', + ], + }, + AppId: { + 'Fn::GetAtt': [ + 'AppF1B96344', + 'AppId', + ], }, - { - Name: 'key2', - Value: 'value2', + BranchName: 'dev', + S3ObjectKey: '8c89eadc6be22019c81ed6b9c7d9929ae10de55679fd8e0e9fd4c00f8edc1cda.zip', + S3BucketName: { + 'Fn::Sub': 'cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}', }, - ], + }); }); -}); -test('with asset deployment', () => { - // WHEN - const asset = new Asset(app, 'SampleAsset', { - path: path.join(__dirname, './test-asset'), - }); - app.addBranch('dev', { asset }); + test('with performance mode', () => { + // WHEN + app.addBranch('dev', { + performanceMode: true, + }); - // THEN - Template.fromStack(stack).hasResourceProperties('Custom::AmplifyAssetDeployment', { - ServiceToken: { - 'Fn::GetAtt': [ - 'comamazonawscdkcustomresourcesamplifyassetdeploymentproviderNestedStackcomamazonawscdkcustomresourcesamplifyassetdeploymentproviderNestedStackResource89BDFEB2', - 'Outputs.comamazonawscdkcustomresourcesamplifyassetdeploymentprovideramplifyassetdeploymenthandlerproviderframeworkonEventA449D9A9Arn', - ], - }, - AppId: { - 'Fn::GetAtt': [ - 'AppF1B96344', - 'AppId', - ], - }, - BranchName: 'dev', - S3ObjectKey: '8c89eadc6be22019c81ed6b9c7d9929ae10de55679fd8e0e9fd4c00f8edc1cda.zip', - S3BucketName: { - 'Fn::Sub': 'cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}', - }, + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::Amplify::Branch', { + EnablePerformanceMode: true, + }); }); -}); -test('with performance mode', () => { - // WHEN - app.addBranch('dev', { - performanceMode: true, - }); + test('with framework', () => { + // WHEN + app.addBranch('dev', { + framework: 'testFramework', + }); - // THEN - Template.fromStack(stack).hasResourceProperties('AWS::Amplify::Branch', { - EnablePerformanceMode: true, + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::Amplify::Branch', { + Framework: 'testFramework', + }); }); -}); +}); \ No newline at end of file diff --git a/packages/@aws-cdk/aws-amplify/test/integ.app-asset-deployment.js.snapshot/cdk-amplify-app-asset-deployment.assets.json b/packages/@aws-cdk/aws-amplify/test/integ.app-asset-deployment.js.snapshot/cdk-amplify-app-asset-deployment.assets.json index b217116c076d6..29c341847d46a 100644 --- a/packages/@aws-cdk/aws-amplify/test/integ.app-asset-deployment.js.snapshot/cdk-amplify-app-asset-deployment.assets.json +++ b/packages/@aws-cdk/aws-amplify/test/integ.app-asset-deployment.js.snapshot/cdk-amplify-app-asset-deployment.assets.json @@ -1,5 +1,5 @@ { - "version": "21.0.0", + "version": "29.0.0", "files": { "673eedce19cf9e5cb7018f3029adb9937d4c7c7b167af1f80c69613cac83b7da": { "source": { diff --git a/packages/@aws-cdk/aws-amplify/test/integ.app-asset-deployment.js.snapshot/cdk.out b/packages/@aws-cdk/aws-amplify/test/integ.app-asset-deployment.js.snapshot/cdk.out index 8ecc185e9dbee..d8b441d447f8a 100644 --- a/packages/@aws-cdk/aws-amplify/test/integ.app-asset-deployment.js.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-amplify/test/integ.app-asset-deployment.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"21.0.0"} \ No newline at end of file +{"version":"29.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-amplify/test/integ.app-asset-deployment.js.snapshot/integ.json b/packages/@aws-cdk/aws-amplify/test/integ.app-asset-deployment.js.snapshot/integ.json index 0a2150f8540d6..63b2f96b46ee6 100644 --- a/packages/@aws-cdk/aws-amplify/test/integ.app-asset-deployment.js.snapshot/integ.json +++ b/packages/@aws-cdk/aws-amplify/test/integ.app-asset-deployment.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "21.0.0", + "version": "29.0.0", "testCases": { "integ.app-asset-deployment": { "stacks": [ diff --git a/packages/@aws-cdk/aws-amplify/test/integ.app-asset-deployment.js.snapshot/manifest.json b/packages/@aws-cdk/aws-amplify/test/integ.app-asset-deployment.js.snapshot/manifest.json index e855dd58d0e04..249c8fe62771a 100644 --- a/packages/@aws-cdk/aws-amplify/test/integ.app-asset-deployment.js.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-amplify/test/integ.app-asset-deployment.js.snapshot/manifest.json @@ -1,12 +1,6 @@ { - "version": "21.0.0", + "version": "29.0.0", "artifacts": { - "Tree": { - "type": "cdk:tree", - "properties": { - "file": "tree.json" - } - }, "cdk-amplify-app-asset-deployment.assets": { "type": "cdk:asset-manifest", "properties": { @@ -62,36 +56,15 @@ "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } - ], - "AppmainF505BAED": [ - { - "type": "aws:cdk:logicalId", - "data": "AppmainF505BAED", - "trace": [ - "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" - ] - } - ], - "AppmainDeploymentResource442DE93D": [ - { - "type": "aws:cdk:logicalId", - "data": "AppmainDeploymentResource442DE93D", - "trace": [ - "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" - ] - } - ], - "comamazonawscdkcustomresourcesamplifyassetdeploymentproviderNestedStackcomamazonawscdkcustomresourcesamplifyassetdeploymentproviderNestedStackResource89BDFEB2": [ - { - "type": "aws:cdk:logicalId", - "data": "comamazonawscdkcustomresourcesamplifyassetdeploymentproviderNestedStackcomamazonawscdkcustomresourcesamplifyassetdeploymentproviderNestedStackResource89BDFEB2", - "trace": [ - "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" - ] - } ] }, "displayName": "cdk-amplify-app-asset-deployment" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-amplify/test/integ.app-asset-deployment.js.snapshot/tree.json b/packages/@aws-cdk/aws-amplify/test/integ.app-asset-deployment.js.snapshot/tree.json index a08e8bd6421b3..7403319e2cbd8 100644 --- a/packages/@aws-cdk/aws-amplify/test/integ.app-asset-deployment.js.snapshot/tree.json +++ b/packages/@aws-cdk/aws-amplify/test/integ.app-asset-deployment.js.snapshot/tree.json @@ -4,14 +4,6 @@ "id": "App", "path": "", "children": { - "Tree": { - "id": "Tree", - "path": "Tree", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.92" - } - }, "cdk-amplify-app-asset-deployment": { "id": "cdk-amplify-app-asset-deployment", "path": "cdk-amplify-app-asset-deployment", @@ -24,6 +16,14 @@ "id": "Role", "path": "cdk-amplify-app-asset-deployment/App/Role", "children": { + "ImportRole": { + "id": "ImportRole", + "path": "cdk-amplify-app-asset-deployment/App/Role/ImportRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, "Resource": { "id": "Resource", "path": "cdk-amplify-app-asset-deployment/App/Role/Resource", @@ -83,12 +83,36 @@ "fqn": "@aws-cdk/aws-amplify.App", "version": "0.0.0" } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "cdk-amplify-app-asset-deployment/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "cdk-amplify-app-asset-deployment/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } } }, "constructInfo": { "fqn": "@aws-cdk/core.Stack", "version": "0.0.0" } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.237" + } } }, "constructInfo": { diff --git a/packages/@aws-cdk/aws-amplify/test/integ.app-codecommit.js.snapshot/cdk-amplify-codecommit-app.assets.json b/packages/@aws-cdk/aws-amplify/test/integ.app-codecommit.js.snapshot/cdk-amplify-codecommit-app.assets.json index 93d2518b4e43d..6da374ed22846 100644 --- a/packages/@aws-cdk/aws-amplify/test/integ.app-codecommit.js.snapshot/cdk-amplify-codecommit-app.assets.json +++ b/packages/@aws-cdk/aws-amplify/test/integ.app-codecommit.js.snapshot/cdk-amplify-codecommit-app.assets.json @@ -1,5 +1,5 @@ { - "version": "20.0.0", + "version": "29.0.0", "files": { "6e52872592f7d527f083f6ccb4f9fb078d5e235d5073d6cdaaba6a8904a37e8c": { "source": { diff --git a/packages/@aws-cdk/aws-amplify/test/integ.app-codecommit.js.snapshot/cdk.out b/packages/@aws-cdk/aws-amplify/test/integ.app-codecommit.js.snapshot/cdk.out index 588d7b269d34f..d8b441d447f8a 100644 --- a/packages/@aws-cdk/aws-amplify/test/integ.app-codecommit.js.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-amplify/test/integ.app-codecommit.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"20.0.0"} \ No newline at end of file +{"version":"29.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-amplify/test/integ.app-codecommit.js.snapshot/integ.json b/packages/@aws-cdk/aws-amplify/test/integ.app-codecommit.js.snapshot/integ.json index 3d3cb3cec5373..e5725e48180cf 100644 --- a/packages/@aws-cdk/aws-amplify/test/integ.app-codecommit.js.snapshot/integ.json +++ b/packages/@aws-cdk/aws-amplify/test/integ.app-codecommit.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "20.0.0", + "version": "29.0.0", "testCases": { "integ.app-codecommit": { "stacks": [ diff --git a/packages/@aws-cdk/aws-amplify/test/integ.app-codecommit.js.snapshot/manifest.json b/packages/@aws-cdk/aws-amplify/test/integ.app-codecommit.js.snapshot/manifest.json index 021bc1764d444..9d5ea517ff9fb 100644 --- a/packages/@aws-cdk/aws-amplify/test/integ.app-codecommit.js.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-amplify/test/integ.app-codecommit.js.snapshot/manifest.json @@ -1,12 +1,6 @@ { - "version": "20.0.0", + "version": "29.0.0", "artifacts": { - "Tree": { - "type": "cdk:tree", - "properties": { - "file": "tree.json" - } - }, "cdk-amplify-codecommit-app.assets": { "type": "cdk:asset-manifest", "properties": { @@ -83,6 +77,12 @@ ] }, "displayName": "cdk-amplify-codecommit-app" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-amplify/test/integ.app-codecommit.js.snapshot/tree.json b/packages/@aws-cdk/aws-amplify/test/integ.app-codecommit.js.snapshot/tree.json index 8a94bd6edc4bc..534c883fa0a3b 100644 --- a/packages/@aws-cdk/aws-amplify/test/integ.app-codecommit.js.snapshot/tree.json +++ b/packages/@aws-cdk/aws-amplify/test/integ.app-codecommit.js.snapshot/tree.json @@ -4,14 +4,6 @@ "id": "App", "path": "", "children": { - "Tree": { - "id": "Tree", - "path": "Tree", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" - } - }, "cdk-amplify-codecommit-app": { "id": "cdk-amplify-codecommit-app", "path": "cdk-amplify-codecommit-app", @@ -48,6 +40,14 @@ "id": "Role", "path": "cdk-amplify-codecommit-app/App/Role", "children": { + "ImportRole": { + "id": "ImportRole", + "path": "cdk-amplify-codecommit-app/App/Role/ImportRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, "Resource": { "id": "Resource", "path": "cdk-amplify-codecommit-app/App/Role/Resource", @@ -189,17 +189,41 @@ "fqn": "@aws-cdk/aws-amplify.App", "version": "0.0.0" } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "cdk-amplify-codecommit-app/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "cdk-amplify-codecommit-app/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } } }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.85" + "version": "10.1.237" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.App", + "version": "0.0.0" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-amplify/test/integ.app.js.snapshot/cdk-amplify-app.assets.json b/packages/@aws-cdk/aws-amplify/test/integ.app.js.snapshot/cdk-amplify-app.assets.json index 493a60542444b..dd2c4c53c9fbd 100644 --- a/packages/@aws-cdk/aws-amplify/test/integ.app.js.snapshot/cdk-amplify-app.assets.json +++ b/packages/@aws-cdk/aws-amplify/test/integ.app.js.snapshot/cdk-amplify-app.assets.json @@ -1,7 +1,7 @@ { - "version": "20.0.0", + "version": "29.0.0", "files": { - "61d61670a5f1b42b9d9a564d09ce8d6715f3e29fb801c67dd4d9d7f153457da9": { + "78b3f485aa1c0d3637eafd63c728e389ac4a4443ece30b9b46c9d43e2bdb8a4d": { "source": { "path": "cdk-amplify-app.template.json", "packaging": "file" @@ -9,7 +9,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "61d61670a5f1b42b9d9a564d09ce8d6715f3e29fb801c67dd4d9d7f153457da9.json", + "objectKey": "78b3f485aa1c0d3637eafd63c728e389ac4a4443ece30b9b46c9d43e2bdb8a4d.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-amplify/test/integ.app.js.snapshot/cdk-amplify-app.template.json b/packages/@aws-cdk/aws-amplify/test/integ.app.js.snapshot/cdk-amplify-app.template.json index ddcac808c7c09..3076cdef10039 100644 --- a/packages/@aws-cdk/aws-amplify/test/integ.app.js.snapshot/cdk-amplify-app.template.json +++ b/packages/@aws-cdk/aws-amplify/test/integ.app.js.snapshot/cdk-amplify-app.template.json @@ -79,7 +79,8 @@ "AppRole1AF9B530", "Arn" ] - } + }, + "Platform": "WEB" } }, "AppmainF505BAED": { @@ -99,7 +100,8 @@ "Name": "key", "Value": "value" } - ] + ], + "Framework": "TestFramework" } } }, diff --git a/packages/@aws-cdk/aws-amplify/test/integ.app.js.snapshot/cdk.out b/packages/@aws-cdk/aws-amplify/test/integ.app.js.snapshot/cdk.out index 588d7b269d34f..d8b441d447f8a 100644 --- a/packages/@aws-cdk/aws-amplify/test/integ.app.js.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-amplify/test/integ.app.js.snapshot/cdk.out @@ -1 +1 @@ -{"version":"20.0.0"} \ No newline at end of file +{"version":"29.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-amplify/test/integ.app.js.snapshot/integ.json b/packages/@aws-cdk/aws-amplify/test/integ.app.js.snapshot/integ.json index c91f15a6149aa..a44589751d01e 100644 --- a/packages/@aws-cdk/aws-amplify/test/integ.app.js.snapshot/integ.json +++ b/packages/@aws-cdk/aws-amplify/test/integ.app.js.snapshot/integ.json @@ -1,5 +1,5 @@ { - "version": "20.0.0", + "version": "29.0.0", "testCases": { "integ.app": { "stacks": [ diff --git a/packages/@aws-cdk/aws-amplify/test/integ.app.js.snapshot/manifest.json b/packages/@aws-cdk/aws-amplify/test/integ.app.js.snapshot/manifest.json index 7e942470c44b0..80ab9fa7fe9a1 100644 --- a/packages/@aws-cdk/aws-amplify/test/integ.app.js.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-amplify/test/integ.app.js.snapshot/manifest.json @@ -1,12 +1,6 @@ { - "version": "20.0.0", + "version": "29.0.0", "artifacts": { - "Tree": { - "type": "cdk:tree", - "properties": { - "file": "tree.json" - } - }, "cdk-amplify-app.assets": { "type": "cdk:asset-manifest", "properties": { @@ -23,7 +17,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/61d61670a5f1b42b9d9a564d09ce8d6715f3e29fb801c67dd4d9d7f153457da9.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/78b3f485aa1c0d3637eafd63c728e389ac4a4443ece30b9b46c9d43e2bdb8a4d.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -77,6 +71,12 @@ ] }, "displayName": "cdk-amplify-app" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-amplify/test/integ.app.js.snapshot/tree.json b/packages/@aws-cdk/aws-amplify/test/integ.app.js.snapshot/tree.json index 5d2caafdff6bc..93bd061d7de78 100644 --- a/packages/@aws-cdk/aws-amplify/test/integ.app.js.snapshot/tree.json +++ b/packages/@aws-cdk/aws-amplify/test/integ.app.js.snapshot/tree.json @@ -4,14 +4,6 @@ "id": "App", "path": "", "children": { - "Tree": { - "id": "Tree", - "path": "Tree", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" - } - }, "cdk-amplify-app": { "id": "cdk-amplify-app", "path": "cdk-amplify-app", @@ -24,6 +16,14 @@ "id": "Role", "path": "cdk-amplify-app/App/Role", "children": { + "ImportRole": { + "id": "ImportRole", + "path": "cdk-amplify-app/App/Role/ImportRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, "Resource": { "id": "Resource", "path": "cdk-amplify-app/App/Role/Resource", @@ -136,7 +136,8 @@ "AppRole1AF9B530", "Arn" ] - } + }, + "platform": "WEB" } }, "constructInfo": { @@ -168,7 +169,8 @@ "name": "key", "value": "value" } - ] + ], + "framework": "TestFramework" } }, "constructInfo": { @@ -187,17 +189,41 @@ "fqn": "@aws-cdk/aws-amplify.App", "version": "0.0.0" } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "cdk-amplify-app/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "cdk-amplify-app/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } } }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.85" + "version": "10.1.237" } } }, "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.85" + "fqn": "@aws-cdk/core.App", + "version": "0.0.0" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-amplify/test/integ.app.ts b/packages/@aws-cdk/aws-amplify/test/integ.app.ts index 602ee47b8ada2..7a94868e5d580 100644 --- a/packages/@aws-cdk/aws-amplify/test/integ.app.ts +++ b/packages/@aws-cdk/aws-amplify/test/integ.app.ts @@ -25,6 +25,7 @@ class TestStack extends Stack { }, }, ], + platform: amplify.Platform.WEB, }); amplifyApp.addCustomRule({ @@ -32,7 +33,9 @@ class TestStack extends Stack { target: '/target', }); - const mainBranch = amplifyApp.addBranch('main'); + const mainBranch = amplifyApp.addBranch('main', { + framework: 'TestFramework', + }); mainBranch.addEnvironment('key', 'value'); } }