diff --git a/aws-ecs/lib/frontend.ts b/aws-ecs/lib/frontend.ts index c40c63a..0c863a5 100644 --- a/aws-ecs/lib/frontend.ts +++ b/aws-ecs/lib/frontend.ts @@ -60,7 +60,10 @@ export class Frontend extends Construct { REACT_APP_AUTH_HOST: bucketName, REACT_APP_HTTP_SCHEME: 'https', REACT_APP_WS_SCHEME: 'wss', - ASSOCIATED_APPS: process.env.APPLE_ASSOCIATED_APPS || '' + ASSOCIATED_APPS: process.env.APPLE_ASSOCIATED_APPS || '', + ANDROID_PACKAGE_NAME: process.env.ANDROID_PACKAGE_NAME || '', + ANDROID_PACKAGE_DOMAIN: process.env.ANDROID_PACKAGE_DOMAIN || '', + ANDROID_PACKAGE_FINGERPRINT: process.env.ANDROID_PACKAGE_FINGERPRINT || '' }, }, }); diff --git a/aws-ecs/lib/pipeline-stack.ts b/aws-ecs/lib/pipeline-stack.ts index 455b2b7..ca331f7 100644 --- a/aws-ecs/lib/pipeline-stack.ts +++ b/aws-ecs/lib/pipeline-stack.ts @@ -42,6 +42,18 @@ const environmentVariables: Record = type: codebuild.BuildEnvironmentVariableType.PARAMETER_STORE, value: "/findy-agency/apple-associated-apps", }, + ANDROID_PACKAGE_NAME: { + type: codebuild.BuildEnvironmentVariableType.PARAMETER_STORE, + value: "/findy-agency/android-package-name", + }, + ANDROID_PACKAGE_DOMAIN: { + type: codebuild.BuildEnvironmentVariableType.PARAMETER_STORE, + value: "/findy-agency/android-package-domain", + }, + ANDROID_PACKAGE_FINGERPRINT: { + type: codebuild.BuildEnvironmentVariableType.PARAMETER_STORE, + value: "/findy-agency/android-package-fingerprint", + }, ADMIN_ID: { type: codebuild.BuildEnvironmentVariableType.SECRETS_MANAGER, value: "FindyAgency:findy-agency-admin-id", diff --git a/aws-ecs/test/__snapshots__/pipeline.test.ts.snap b/aws-ecs/test/__snapshots__/pipeline.test.ts.snap index a6bf2e3..1b97cf0 100644 --- a/aws-ecs/test/__snapshots__/pipeline.test.ts.snap +++ b/aws-ecs/test/__snapshots__/pipeline.test.ts.snap @@ -586,7 +586,7 @@ Object { "Version": "1", }, "Configuration": Object { - "EnvironmentVariables": "[{\\"name\\":\\"_PROJECT_CONFIG_HASH\\",\\"type\\":\\"PLAINTEXT\\",\\"value\\":\\"87dffae732f083c54abe47426eb5e049edf83ab962fd3389823723d4c339513b\\"}]", + "EnvironmentVariables": "[{\\"name\\":\\"_PROJECT_CONFIG_HASH\\",\\"type\\":\\"PLAINTEXT\\",\\"value\\":\\"3e2c7ed46796689d1f61de89193c6bffce64838e53d8cfe0eeaad22b8eea0292\\"}]", "PrimarySource": "findy_network_findy_agent_infra_Source", "ProjectName": Object { "Ref": "PipelineBuildSynthStepCdkBuildProject7FBB5116", @@ -636,7 +636,7 @@ Object { "Version": "1", }, "Configuration": Object { - "EnvironmentVariables": "[{\\"name\\":\\"_PROJECT_CONFIG_HASH\\",\\"type\\":\\"PLAINTEXT\\",\\"value\\":\\"2d1c49496b1ae1a2ae1b465fab6f546dc3da8dee7a77e7c4e40590fc95d3d34b\\"}]", + "EnvironmentVariables": "[{\\"name\\":\\"_PROJECT_CONFIG_HASH\\",\\"type\\":\\"PLAINTEXT\\",\\"value\\":\\"86e50257e15d9196af9a3fe69800c9a8ba7e1ddea4cb870a2c8256f5389c4050\\"}]", "ProjectName": Object { "Ref": "PipelineUpdatePipelineSelfMutationDAA41400", }, @@ -1151,6 +1151,21 @@ Object { "Type": "PARAMETER_STORE", "Value": "/findy-agency/apple-associated-apps", }, + Object { + "Name": "ANDROID_PACKAGE_NAME", + "Type": "PARAMETER_STORE", + "Value": "/findy-agency/android-package-name", + }, + Object { + "Name": "ANDROID_PACKAGE_DOMAIN", + "Type": "PARAMETER_STORE", + "Value": "/findy-agency/android-package-domain", + }, + Object { + "Name": "ANDROID_PACKAGE_FINGERPRINT", + "Type": "PARAMETER_STORE", + "Value": "/findy-agency/android-package-fingerprint", + }, Object { "Name": "ADMIN_ID", "Type": "SECRETS_MANAGER", @@ -1218,6 +1233,21 @@ Object { "Type": "PARAMETER_STORE", "Value": "/findy-agency/apple-associated-apps", }, + Object { + "Name": "ANDROID_PACKAGE_NAME", + "Type": "PARAMETER_STORE", + "Value": "/findy-agency/android-package-name", + }, + Object { + "Name": "ANDROID_PACKAGE_DOMAIN", + "Type": "PARAMETER_STORE", + "Value": "/findy-agency/android-package-domain", + }, + Object { + "Name": "ANDROID_PACKAGE_FINGERPRINT", + "Type": "PARAMETER_STORE", + "Value": "/findy-agency/android-package-fingerprint", + }, Object { "Name": "ADMIN_ID", "Type": "SECRETS_MANAGER", @@ -1285,6 +1315,21 @@ Object { "Type": "PARAMETER_STORE", "Value": "/findy-agency/apple-associated-apps", }, + Object { + "Name": "ANDROID_PACKAGE_NAME", + "Type": "PARAMETER_STORE", + "Value": "/findy-agency/android-package-name", + }, + Object { + "Name": "ANDROID_PACKAGE_DOMAIN", + "Type": "PARAMETER_STORE", + "Value": "/findy-agency/android-package-domain", + }, + Object { + "Name": "ANDROID_PACKAGE_FINGERPRINT", + "Type": "PARAMETER_STORE", + "Value": "/findy-agency/android-package-fingerprint", + }, Object { "Name": "ADMIN_ID", "Type": "SECRETS_MANAGER", @@ -1352,6 +1397,21 @@ Object { "Type": "PARAMETER_STORE", "Value": "/findy-agency/apple-associated-apps", }, + Object { + "Name": "ANDROID_PACKAGE_NAME", + "Type": "PARAMETER_STORE", + "Value": "/findy-agency/android-package-name", + }, + Object { + "Name": "ANDROID_PACKAGE_DOMAIN", + "Type": "PARAMETER_STORE", + "Value": "/findy-agency/android-package-domain", + }, + Object { + "Name": "ANDROID_PACKAGE_FINGERPRINT", + "Type": "PARAMETER_STORE", + "Value": "/findy-agency/android-package-fingerprint", + }, Object { "Name": "ADMIN_ID", "Type": "SECRETS_MANAGER", @@ -1419,6 +1479,21 @@ Object { "Type": "PARAMETER_STORE", "Value": "/findy-agency/apple-associated-apps", }, + Object { + "Name": "ANDROID_PACKAGE_NAME", + "Type": "PARAMETER_STORE", + "Value": "/findy-agency/android-package-name", + }, + Object { + "Name": "ANDROID_PACKAGE_DOMAIN", + "Type": "PARAMETER_STORE", + "Value": "/findy-agency/android-package-domain", + }, + Object { + "Name": "ANDROID_PACKAGE_FINGERPRINT", + "Type": "PARAMETER_STORE", + "Value": "/findy-agency/android-package-fingerprint", + }, Object { "Name": "ADMIN_ID", "Type": "SECRETS_MANAGER", @@ -1486,6 +1561,21 @@ Object { "Type": "PARAMETER_STORE", "Value": "/findy-agency/apple-associated-apps", }, + Object { + "Name": "ANDROID_PACKAGE_NAME", + "Type": "PARAMETER_STORE", + "Value": "/findy-agency/android-package-name", + }, + Object { + "Name": "ANDROID_PACKAGE_DOMAIN", + "Type": "PARAMETER_STORE", + "Value": "/findy-agency/android-package-domain", + }, + Object { + "Name": "ANDROID_PACKAGE_FINGERPRINT", + "Type": "PARAMETER_STORE", + "Value": "/findy-agency/android-package-fingerprint", + }, Object { "Name": "ADMIN_ID", "Type": "SECRETS_MANAGER", @@ -1676,6 +1766,42 @@ Object { ], ], }, + Object { + "Fn::Join": Array [ + "", + Array [ + "arn:", + Object { + "Ref": "AWS::Partition", + }, + ":ssm:us-east-1:123456789012:parameter/findy-agency/android-package-name", + ], + ], + }, + Object { + "Fn::Join": Array [ + "", + Array [ + "arn:", + Object { + "Ref": "AWS::Partition", + }, + ":ssm:us-east-1:123456789012:parameter/findy-agency/android-package-domain", + ], + ], + }, + Object { + "Fn::Join": Array [ + "", + Array [ + "arn:", + Object { + "Ref": "AWS::Partition", + }, + ":ssm:us-east-1:123456789012:parameter/findy-agency/android-package-fingerprint", + ], + ], + }, ], }, Object { @@ -1774,6 +1900,21 @@ Object { "Type": "PARAMETER_STORE", "Value": "/findy-agency/apple-associated-apps", }, + Object { + "Name": "ANDROID_PACKAGE_NAME", + "Type": "PARAMETER_STORE", + "Value": "/findy-agency/android-package-name", + }, + Object { + "Name": "ANDROID_PACKAGE_DOMAIN", + "Type": "PARAMETER_STORE", + "Value": "/findy-agency/android-package-domain", + }, + Object { + "Name": "ANDROID_PACKAGE_FINGERPRINT", + "Type": "PARAMETER_STORE", + "Value": "/findy-agency/android-package-fingerprint", + }, Object { "Name": "ADMIN_ID", "Type": "SECRETS_MANAGER", @@ -1922,6 +2063,42 @@ Object { ], ], }, + Object { + "Fn::Join": Array [ + "", + Array [ + "arn:", + Object { + "Ref": "AWS::Partition", + }, + ":ssm:us-east-1:123456789012:parameter/findy-agency/android-package-name", + ], + ], + }, + Object { + "Fn::Join": Array [ + "", + Array [ + "arn:", + Object { + "Ref": "AWS::Partition", + }, + ":ssm:us-east-1:123456789012:parameter/findy-agency/android-package-domain", + ], + ], + }, + Object { + "Fn::Join": Array [ + "", + Array [ + "arn:", + Object { + "Ref": "AWS::Partition", + }, + ":ssm:us-east-1:123456789012:parameter/findy-agency/android-package-fingerprint", + ], + ], + }, Object { "Fn::Join": Array [ "", @@ -2303,6 +2480,21 @@ Object { "Type": "PARAMETER_STORE", "Value": "/findy-agency/apple-associated-apps", }, + Object { + "Name": "ANDROID_PACKAGE_NAME", + "Type": "PARAMETER_STORE", + "Value": "/findy-agency/android-package-name", + }, + Object { + "Name": "ANDROID_PACKAGE_DOMAIN", + "Type": "PARAMETER_STORE", + "Value": "/findy-agency/android-package-domain", + }, + Object { + "Name": "ANDROID_PACKAGE_FINGERPRINT", + "Type": "PARAMETER_STORE", + "Value": "/findy-agency/android-package-fingerprint", + }, Object { "Name": "ADMIN_ID", "Type": "SECRETS_MANAGER", @@ -2437,6 +2629,42 @@ Object { ], ], }, + Object { + "Fn::Join": Array [ + "", + Array [ + "arn:", + Object { + "Ref": "AWS::Partition", + }, + ":ssm:us-east-1:123456789012:parameter/findy-agency/android-package-name", + ], + ], + }, + Object { + "Fn::Join": Array [ + "", + Array [ + "arn:", + Object { + "Ref": "AWS::Partition", + }, + ":ssm:us-east-1:123456789012:parameter/findy-agency/android-package-domain", + ], + ], + }, + Object { + "Fn::Join": Array [ + "", + Array [ + "arn:", + Object { + "Ref": "AWS::Partition", + }, + ":ssm:us-east-1:123456789012:parameter/findy-agency/android-package-fingerprint", + ], + ], + }, ], }, Object { @@ -2609,6 +2837,21 @@ Object { "Type": "PARAMETER_STORE", "Value": "/findy-agency/apple-associated-apps", }, + Object { + "Name": "ANDROID_PACKAGE_NAME", + "Type": "PARAMETER_STORE", + "Value": "/findy-agency/android-package-name", + }, + Object { + "Name": "ANDROID_PACKAGE_DOMAIN", + "Type": "PARAMETER_STORE", + "Value": "/findy-agency/android-package-domain", + }, + Object { + "Name": "ANDROID_PACKAGE_FINGERPRINT", + "Type": "PARAMETER_STORE", + "Value": "/findy-agency/android-package-fingerprint", + }, Object { "Name": "ADMIN_ID", "Type": "SECRETS_MANAGER", @@ -2738,6 +2981,42 @@ Object { ], ], }, + Object { + "Fn::Join": Array [ + "", + Array [ + "arn:", + Object { + "Ref": "AWS::Partition", + }, + ":ssm:us-east-1:123456789012:parameter/findy-agency/android-package-name", + ], + ], + }, + Object { + "Fn::Join": Array [ + "", + Array [ + "arn:", + Object { + "Ref": "AWS::Partition", + }, + ":ssm:us-east-1:123456789012:parameter/findy-agency/android-package-domain", + ], + ], + }, + Object { + "Fn::Join": Array [ + "", + Array [ + "arn:", + Object { + "Ref": "AWS::Partition", + }, + ":ssm:us-east-1:123456789012:parameter/findy-agency/android-package-fingerprint", + ], + ], + }, ], }, Object { @@ -2915,6 +3194,21 @@ Object { "Type": "PARAMETER_STORE", "Value": "/findy-agency/apple-associated-apps", }, + Object { + "Name": "ANDROID_PACKAGE_NAME", + "Type": "PARAMETER_STORE", + "Value": "/findy-agency/android-package-name", + }, + Object { + "Name": "ANDROID_PACKAGE_DOMAIN", + "Type": "PARAMETER_STORE", + "Value": "/findy-agency/android-package-domain", + }, + Object { + "Name": "ANDROID_PACKAGE_FINGERPRINT", + "Type": "PARAMETER_STORE", + "Value": "/findy-agency/android-package-fingerprint", + }, Object { "Name": "ADMIN_ID", "Type": "SECRETS_MANAGER", @@ -3084,6 +3378,42 @@ Object { ], ], }, + Object { + "Fn::Join": Array [ + "", + Array [ + "arn:", + Object { + "Ref": "AWS::Partition", + }, + ":ssm:us-east-1:123456789012:parameter/findy-agency/android-package-name", + ], + ], + }, + Object { + "Fn::Join": Array [ + "", + Array [ + "arn:", + Object { + "Ref": "AWS::Partition", + }, + ":ssm:us-east-1:123456789012:parameter/findy-agency/android-package-domain", + ], + ], + }, + Object { + "Fn::Join": Array [ + "", + Array [ + "arn:", + Object { + "Ref": "AWS::Partition", + }, + ":ssm:us-east-1:123456789012:parameter/findy-agency/android-package-fingerprint", + ], + ], + }, ], }, Object { @@ -3955,6 +4285,21 @@ Object { "Type": "PARAMETER_STORE", "Value": "/findy-agency/apple-associated-apps", }, + Object { + "Name": "ANDROID_PACKAGE_NAME", + "Type": "PARAMETER_STORE", + "Value": "/findy-agency/android-package-name", + }, + Object { + "Name": "ANDROID_PACKAGE_DOMAIN", + "Type": "PARAMETER_STORE", + "Value": "/findy-agency/android-package-domain", + }, + Object { + "Name": "ANDROID_PACKAGE_FINGERPRINT", + "Type": "PARAMETER_STORE", + "Value": "/findy-agency/android-package-fingerprint", + }, Object { "Name": "ADMIN_ID", "Type": "SECRETS_MANAGER", @@ -4084,6 +4429,42 @@ Object { ], ], }, + Object { + "Fn::Join": Array [ + "", + Array [ + "arn:", + Object { + "Ref": "AWS::Partition", + }, + ":ssm:us-east-1:123456789012:parameter/findy-agency/android-package-name", + ], + ], + }, + Object { + "Fn::Join": Array [ + "", + Array [ + "arn:", + Object { + "Ref": "AWS::Partition", + }, + ":ssm:us-east-1:123456789012:parameter/findy-agency/android-package-domain", + ], + ], + }, + Object { + "Fn::Join": Array [ + "", + Array [ + "arn:", + Object { + "Ref": "AWS::Partition", + }, + ":ssm:us-east-1:123456789012:parameter/findy-agency/android-package-fingerprint", + ], + ], + }, ], }, Object { diff --git a/aws-ecs/tools/init.sh b/aws-ecs/tools/init.sh index 5743f60..e1a7a0c 100755 --- a/aws-ecs/tools/init.sh +++ b/aws-ecs/tools/init.sh @@ -15,6 +15,18 @@ if [ -z "$APPLE_ASSOCIATED_APPS" ]; then echo "WARNING: No Apple associated apps defined" fi +if [ -z "$ANDROID_PACKAGE_NAME" ]; then + echo "WARNING: No Android package name defined" +fi + +if [ -z "$ANDROID_PACKAGE_DOMAIN" ]; then + echo "WARNING: No Android domain defined" +fi + +if [ -z "$ANDROID_PACKAGE_FINGERPRINT" ]; then + echo "WARNING: No Android fingerprint defined" +fi + if [ -z "$GITHUB_CONNECTION_ARN" ]; then echo "ERROR: Define env variable GITHUB_CONNECTION_ARN" exit 1