From 2ec91bce7d3986dedd85efb0c659825bab35830c Mon Sep 17 00:00:00 2001 From: Janario Oliveira Date: Sat, 13 Mar 2021 14:29:31 +0100 Subject: [PATCH] Changed documentation of amplify to use yaml object. Changed test cases to use yaml format --- packages/@aws-cdk/aws-amplify/README.md | 2 +- packages/@aws-cdk/aws-amplify/test/app.test.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/@aws-cdk/aws-amplify/README.md b/packages/@aws-cdk/aws-amplify/README.md index b8e3bd91c2306..e4636d1f065fa 100644 --- a/packages/@aws-cdk/aws-amplify/README.md +++ b/packages/@aws-cdk/aws-amplify/README.md @@ -38,7 +38,7 @@ const amplifyApp = new amplify.App(this, 'MyApp', { repository: '', oauthToken: cdk.SecretValue.secretsManager('my-github-token') }), - buildSpec: codebuild.BuildSpec.fromObject({ // Alternatively add a `amplify.yml` to the repo + buildSpec: codebuild.BuildSpec.yamlFromObject({ // Alternatively add a `amplify.yml` to the repo version: '1.0', frontend: { phases: { diff --git a/packages/@aws-cdk/aws-amplify/test/app.test.ts b/packages/@aws-cdk/aws-amplify/test/app.test.ts index 8cff8e3d5b66d..4581e7bec2ad6 100644 --- a/packages/@aws-cdk/aws-amplify/test/app.test.ts +++ b/packages/@aws-cdk/aws-amplify/test/app.test.ts @@ -17,7 +17,7 @@ test('create an app connected to a GitHub repository', () => { repository: 'aws-cdk', oauthToken: SecretValue.plainText('secret'), }), - buildSpec: codebuild.BuildSpec.fromObject({ + buildSpec: codebuild.BuildSpec.yamlFromObject({ version: '1.0', frontend: { phases: { @@ -34,7 +34,7 @@ test('create an app connected to a GitHub repository', () => { // THEN expect(stack).toHaveResource('AWS::Amplify::App', { Name: 'App', - BuildSpec: '{\n \"version\": \"1.0\",\n \"frontend\": {\n \"phases\": {\n \"build\": {\n \"commands\": [\n \"npm run build\"\n ]\n }\n }\n }\n}', + BuildSpec: 'version: \"1.0\"\nfrontend:\n phases:\n build:\n commands:\n - npm run build\n', IAMServiceRole: { 'Fn::GetAtt': [ 'AppRole1AF9B530', @@ -69,7 +69,7 @@ test('create an app connected to a GitLab repository', () => { repository: 'aws-cdk', oauthToken: SecretValue.plainText('secret'), }), - buildSpec: codebuild.BuildSpec.fromObject({ + buildSpec: codebuild.BuildSpec.yamlFromObject({ version: '1.0', frontend: { phases: { @@ -86,7 +86,7 @@ test('create an app connected to a GitLab repository', () => { // THEN expect(stack).toHaveResource('AWS::Amplify::App', { Name: 'App', - BuildSpec: '{\n \"version\": \"1.0\",\n \"frontend\": {\n \"phases\": {\n \"build\": {\n \"commands\": [\n \"npm run build\"\n ]\n }\n }\n }\n}', + BuildSpec: 'version: \"1.0\"\nfrontend:\n phases:\n build:\n commands:\n - npm run build\n', IAMServiceRole: { 'Fn::GetAtt': [ 'AppRole1AF9B530',