diff --git a/aws/cdk.context.json b/aws/cdk.context.json new file mode 100644 index 0000000..71fb79b --- /dev/null +++ b/aws/cdk.context.json @@ -0,0 +1,7 @@ +{ + "ssm:account=985713782822:parameterName=CertificateArn-www.wakemygameup.com:region=us-east-1": "arn:aws:acm:us-east-1:985713782822:certificate/092c0295-caf5-4944-80b2-3263b6b63392", + "hosted-zone:account=985713782822:domainName=wakemygameup.com:region=us-east-1": { + "Id": "/hostedzone/Z2LN05VHV1XSN1", + "Name": "wakemygameup.com." + } +} diff --git a/aws/cdk.json b/aws/cdk.json index d4610af..8f91547 100644 --- a/aws/cdk.json +++ b/aws/cdk.json @@ -6,5 +6,6 @@ "websitePrefix": "www", "apiPrefix": "api" } - } + }, + "outdir": "./template-output" } \ No newline at end of file diff --git a/aws/package-lock.json b/aws/package-lock.json index 392af8e..59bf6fe 100644 --- a/aws/package-lock.json +++ b/aws/package-lock.json @@ -16,14 +16,86 @@ } }, "@aws-cdk/assets": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@aws-cdk/assets/-/assets-0.25.0.tgz", - "integrity": "sha512-NuNKvNnqeBa0q+UV/wBqw9PPut+K3e2/FHrh1GJY4dPK3QnFXPoDXf8ZI0Js2WbDHpgjwLaIMG6r5Zudk14nIg==", - "requires": { - "@aws-cdk/aws-iam": "^0.25.0", - "@aws-cdk/aws-s3": "^0.25.0", - "@aws-cdk/cdk": "^0.25.0", - "@aws-cdk/cx-api": "^0.25.0" + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@aws-cdk/assets/-/assets-0.25.2.tgz", + "integrity": "sha512-EvaByixcxi2IFaOnv6ldQJ7CANOyqNXhl4DuaqegtH5N5XDJyo3jgQ7sOP4ZpY2TIzIxVOOEZIkUuAcb6r/I0Q==", + "requires": { + "@aws-cdk/aws-iam": "^0.25.2", + "@aws-cdk/aws-s3": "^0.25.2", + "@aws-cdk/cdk": "^0.25.2", + "@aws-cdk/cx-api": "^0.25.2" + }, + "dependencies": { + "@aws-cdk/aws-codepipeline-api": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@aws-cdk/aws-codepipeline-api/-/aws-codepipeline-api-0.25.2.tgz", + "integrity": "sha512-NVuHWZnYH6xh8wDvtLGrfOGRuzeUbQ12bdd56QOnnDnS2IB5dujUfCmTE0axlBxme3XfGHPD39XH2rJVBpYULg==", + "requires": { + "@aws-cdk/aws-events": "^0.25.2", + "@aws-cdk/aws-iam": "^0.25.2", + "@aws-cdk/cdk": "^0.25.2" + } + }, + "@aws-cdk/aws-events": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@aws-cdk/aws-events/-/aws-events-0.25.2.tgz", + "integrity": "sha512-swnXLoPzvKzqnlH+8RkbC2LUdyLVMyvqcRy36EPowC2Ka8Vr+NGKHz9pUDXXiYxh8dGXQG8260kBKkM13rHzNw==", + "requires": { + "@aws-cdk/aws-iam": "^0.25.2", + "@aws-cdk/cdk": "^0.25.2" + } + }, + "@aws-cdk/aws-iam": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@aws-cdk/aws-iam/-/aws-iam-0.25.2.tgz", + "integrity": "sha512-9tetNWnRueOPuOEW9MkyrbxfsvaIiNQ0c3YEXgXkHDWbsDEZO0yUzFp3ugKtWk8GjiVFQzDpcgkxBYTCBbsuWw==", + "requires": { + "@aws-cdk/cdk": "^0.25.2" + } + }, + "@aws-cdk/aws-kms": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@aws-cdk/aws-kms/-/aws-kms-0.25.2.tgz", + "integrity": "sha512-T46WX3oVqB1iLv46/Uu4eSa5ZCd0NLCQU2vW3oIlb6CZBgM4FVBtMl2nIvxF42ml2FOMXov46J4Tcv6LIdAxnw==", + "requires": { + "@aws-cdk/aws-iam": "^0.25.2", + "@aws-cdk/cdk": "^0.25.2" + } + }, + "@aws-cdk/aws-s3": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@aws-cdk/aws-s3/-/aws-s3-0.25.2.tgz", + "integrity": "sha512-Y4Po1CYwj7VIPQV3xZcAQpiwvd4+M/eqTHa/y1vgn4P5K6CRjFDiN6UyJG1iD32h5gk79e3Bs59QbBiIPEGAXA==", + "requires": { + "@aws-cdk/aws-codepipeline-api": "^0.25.2", + "@aws-cdk/aws-events": "^0.25.2", + "@aws-cdk/aws-iam": "^0.25.2", + "@aws-cdk/aws-kms": "^0.25.2", + "@aws-cdk/aws-s3-notifications": "^0.25.2", + "@aws-cdk/cdk": "^0.25.2" + } + }, + "@aws-cdk/aws-s3-notifications": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@aws-cdk/aws-s3-notifications/-/aws-s3-notifications-0.25.2.tgz", + "integrity": "sha512-r6vPkDIT83qEMdbOegKoQIwzxBFMaXUuACRNBirP5mdFf96g71SHpk8MQjMgkoWb2qh+HZ6uklVNPHX2KcJ3+w==", + "requires": { + "@aws-cdk/cdk": "^0.25.2" + } + }, + "@aws-cdk/cdk": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@aws-cdk/cdk/-/cdk-0.25.2.tgz", + "integrity": "sha512-oJLF50GPFL8zGBxCn5WZdAFEuhx+uXI0egbAsR32aqX3c0a3+SOAL0r/da/iNU7KkFdjUibt3cPSChay77YCvw==", + "requires": { + "@aws-cdk/cx-api": "^0.25.2" + } + }, + "@aws-cdk/cx-api": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@aws-cdk/cx-api/-/cx-api-0.25.2.tgz", + "integrity": "sha512-MHFnldhVYwjEb023PDzyaq1Uh+6Q2by8ZIGoEjEQIhvc3OidgQ6FrRMSgeT0r1wE7c2va7yi+rpPC3MHAkHf9A==" + } } }, "@aws-cdk/aws-apigateway": { @@ -85,6 +157,91 @@ "@aws-cdk/cdk": "^0.25.0" } }, + "@aws-cdk/aws-codepipeline": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@aws-cdk/aws-codepipeline/-/aws-codepipeline-0.25.2.tgz", + "integrity": "sha512-siyfQiCtjc7vGNJiiNFvOI/3SZ6gTHgu8c2YkOWQw9gNtLac8LQ4buM7kuR9XuacvpNgAJvMcIgIDLaLnncS0w==", + "requires": { + "@aws-cdk/aws-codepipeline-api": "^0.25.2", + "@aws-cdk/aws-events": "^0.25.2", + "@aws-cdk/aws-iam": "^0.25.2", + "@aws-cdk/aws-s3": "^0.25.2", + "@aws-cdk/aws-sns": "^0.25.2", + "@aws-cdk/cdk": "^0.25.2" + }, + "dependencies": { + "@aws-cdk/aws-codepipeline-api": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@aws-cdk/aws-codepipeline-api/-/aws-codepipeline-api-0.25.2.tgz", + "integrity": "sha512-NVuHWZnYH6xh8wDvtLGrfOGRuzeUbQ12bdd56QOnnDnS2IB5dujUfCmTE0axlBxme3XfGHPD39XH2rJVBpYULg==", + "requires": { + "@aws-cdk/aws-events": "^0.25.2", + "@aws-cdk/aws-iam": "^0.25.2", + "@aws-cdk/cdk": "^0.25.2" + } + }, + "@aws-cdk/aws-events": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@aws-cdk/aws-events/-/aws-events-0.25.2.tgz", + "integrity": "sha512-swnXLoPzvKzqnlH+8RkbC2LUdyLVMyvqcRy36EPowC2Ka8Vr+NGKHz9pUDXXiYxh8dGXQG8260kBKkM13rHzNw==", + "requires": { + "@aws-cdk/aws-iam": "^0.25.2", + "@aws-cdk/cdk": "^0.25.2" + } + }, + "@aws-cdk/aws-iam": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@aws-cdk/aws-iam/-/aws-iam-0.25.2.tgz", + "integrity": "sha512-9tetNWnRueOPuOEW9MkyrbxfsvaIiNQ0c3YEXgXkHDWbsDEZO0yUzFp3ugKtWk8GjiVFQzDpcgkxBYTCBbsuWw==", + "requires": { + "@aws-cdk/cdk": "^0.25.2" + } + }, + "@aws-cdk/aws-kms": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@aws-cdk/aws-kms/-/aws-kms-0.25.2.tgz", + "integrity": "sha512-T46WX3oVqB1iLv46/Uu4eSa5ZCd0NLCQU2vW3oIlb6CZBgM4FVBtMl2nIvxF42ml2FOMXov46J4Tcv6LIdAxnw==", + "requires": { + "@aws-cdk/aws-iam": "^0.25.2", + "@aws-cdk/cdk": "^0.25.2" + } + }, + "@aws-cdk/aws-s3": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@aws-cdk/aws-s3/-/aws-s3-0.25.2.tgz", + "integrity": "sha512-Y4Po1CYwj7VIPQV3xZcAQpiwvd4+M/eqTHa/y1vgn4P5K6CRjFDiN6UyJG1iD32h5gk79e3Bs59QbBiIPEGAXA==", + "requires": { + "@aws-cdk/aws-codepipeline-api": "^0.25.2", + "@aws-cdk/aws-events": "^0.25.2", + "@aws-cdk/aws-iam": "^0.25.2", + "@aws-cdk/aws-kms": "^0.25.2", + "@aws-cdk/aws-s3-notifications": "^0.25.2", + "@aws-cdk/cdk": "^0.25.2" + } + }, + "@aws-cdk/aws-s3-notifications": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@aws-cdk/aws-s3-notifications/-/aws-s3-notifications-0.25.2.tgz", + "integrity": "sha512-r6vPkDIT83qEMdbOegKoQIwzxBFMaXUuACRNBirP5mdFf96g71SHpk8MQjMgkoWb2qh+HZ6uklVNPHX2KcJ3+w==", + "requires": { + "@aws-cdk/cdk": "^0.25.2" + } + }, + "@aws-cdk/cdk": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@aws-cdk/cdk/-/cdk-0.25.2.tgz", + "integrity": "sha512-oJLF50GPFL8zGBxCn5WZdAFEuhx+uXI0egbAsR32aqX3c0a3+SOAL0r/da/iNU7KkFdjUibt3cPSChay77YCvw==", + "requires": { + "@aws-cdk/cx-api": "^0.25.2" + } + }, + "@aws-cdk/cx-api": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@aws-cdk/cx-api/-/cx-api-0.25.2.tgz", + "integrity": "sha512-MHFnldhVYwjEb023PDzyaq1Uh+6Q2by8ZIGoEjEQIhvc3OidgQ6FrRMSgeT0r1wE7c2va7yi+rpPC3MHAkHf9A==" + } + } + }, "@aws-cdk/aws-codepipeline-api": { "version": "0.25.0", "resolved": "https://registry.npmjs.org/@aws-cdk/aws-codepipeline-api/-/aws-codepipeline-api-0.25.0.tgz", @@ -207,6 +364,175 @@ "@aws-cdk/cdk": "^0.25.0" } }, + "@aws-cdk/aws-sns": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@aws-cdk/aws-sns/-/aws-sns-0.25.2.tgz", + "integrity": "sha512-mpGnVWFqoC/+6tkgecYc7V6HMveFZ8GBKh6pDFy2G4h6Uf9FvGLlwX/l8uOGo28d5dpqh5vYbrxryh8RqJV9gg==", + "requires": { + "@aws-cdk/aws-autoscaling-api": "^0.25.2", + "@aws-cdk/aws-cloudwatch": "^0.25.2", + "@aws-cdk/aws-events": "^0.25.2", + "@aws-cdk/aws-iam": "^0.25.2", + "@aws-cdk/aws-lambda": "^0.25.2", + "@aws-cdk/aws-s3-notifications": "^0.25.2", + "@aws-cdk/aws-sqs": "^0.25.2", + "@aws-cdk/cdk": "^0.25.2" + }, + "dependencies": { + "@aws-cdk/aws-autoscaling-api": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@aws-cdk/aws-autoscaling-api/-/aws-autoscaling-api-0.25.2.tgz", + "integrity": "sha512-F1XU7GBdYQZ2NZCnxvt3ptczwEdJgsH/xnY5q5kX8VVZVOBrrJ7xi0fKvPZzr2G4LMQBO9bLYVYP2jmlmwxPAg==", + "requires": { + "@aws-cdk/aws-iam": "^0.25.2", + "@aws-cdk/cdk": "^0.25.2" + } + }, + "@aws-cdk/aws-cloudwatch": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@aws-cdk/aws-cloudwatch/-/aws-cloudwatch-0.25.2.tgz", + "integrity": "sha512-besLjOd/uicKK6pPgKJ/J2UAPZd3GtbQ0c+OGLGVl29uKCUUpaf4DSrABdmw08YzR/SbTJDoiJqhLy992IGYFQ==", + "requires": { + "@aws-cdk/aws-iam": "^0.25.2", + "@aws-cdk/cdk": "^0.25.2" + } + }, + "@aws-cdk/aws-codepipeline-api": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@aws-cdk/aws-codepipeline-api/-/aws-codepipeline-api-0.25.2.tgz", + "integrity": "sha512-NVuHWZnYH6xh8wDvtLGrfOGRuzeUbQ12bdd56QOnnDnS2IB5dujUfCmTE0axlBxme3XfGHPD39XH2rJVBpYULg==", + "requires": { + "@aws-cdk/aws-events": "^0.25.2", + "@aws-cdk/aws-iam": "^0.25.2", + "@aws-cdk/cdk": "^0.25.2" + } + }, + "@aws-cdk/aws-ec2": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@aws-cdk/aws-ec2/-/aws-ec2-0.25.2.tgz", + "integrity": "sha512-vJohi8jYHa/3Ji0gvyQiV5dPwqPXaxFZrfSYu8CDJQ6Ljc04lcDsQnUWiyUndMHGlcFBJ7tq6NklR7sT/9ODiA==", + "requires": { + "@aws-cdk/aws-iam": "^0.25.2", + "@aws-cdk/cdk": "^0.25.2", + "@aws-cdk/cx-api": "^0.25.2" + } + }, + "@aws-cdk/aws-events": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@aws-cdk/aws-events/-/aws-events-0.25.2.tgz", + "integrity": "sha512-swnXLoPzvKzqnlH+8RkbC2LUdyLVMyvqcRy36EPowC2Ka8Vr+NGKHz9pUDXXiYxh8dGXQG8260kBKkM13rHzNw==", + "requires": { + "@aws-cdk/aws-iam": "^0.25.2", + "@aws-cdk/cdk": "^0.25.2" + } + }, + "@aws-cdk/aws-iam": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@aws-cdk/aws-iam/-/aws-iam-0.25.2.tgz", + "integrity": "sha512-9tetNWnRueOPuOEW9MkyrbxfsvaIiNQ0c3YEXgXkHDWbsDEZO0yUzFp3ugKtWk8GjiVFQzDpcgkxBYTCBbsuWw==", + "requires": { + "@aws-cdk/cdk": "^0.25.2" + } + }, + "@aws-cdk/aws-kms": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@aws-cdk/aws-kms/-/aws-kms-0.25.2.tgz", + "integrity": "sha512-T46WX3oVqB1iLv46/Uu4eSa5ZCd0NLCQU2vW3oIlb6CZBgM4FVBtMl2nIvxF42ml2FOMXov46J4Tcv6LIdAxnw==", + "requires": { + "@aws-cdk/aws-iam": "^0.25.2", + "@aws-cdk/cdk": "^0.25.2" + } + }, + "@aws-cdk/aws-lambda": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@aws-cdk/aws-lambda/-/aws-lambda-0.25.2.tgz", + "integrity": "sha512-SWNUtC0bbafImm+PgNYVKlD54VSZx9VhP/yrj+b5YCxCm0bzQFXyaoJhiQET1zzTnOoprGX55GcHiQ/hIAkmAg==", + "requires": { + "@aws-cdk/assets": "^0.25.2", + "@aws-cdk/aws-cloudwatch": "^0.25.2", + "@aws-cdk/aws-codepipeline-api": "^0.25.2", + "@aws-cdk/aws-ec2": "^0.25.2", + "@aws-cdk/aws-events": "^0.25.2", + "@aws-cdk/aws-iam": "^0.25.2", + "@aws-cdk/aws-logs": "^0.25.2", + "@aws-cdk/aws-s3": "^0.25.2", + "@aws-cdk/aws-s3-notifications": "^0.25.2", + "@aws-cdk/aws-sqs": "^0.25.2", + "@aws-cdk/aws-stepfunctions": "^0.25.2", + "@aws-cdk/cdk": "^0.25.2", + "@aws-cdk/cx-api": "^0.25.2" + } + }, + "@aws-cdk/aws-logs": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@aws-cdk/aws-logs/-/aws-logs-0.25.2.tgz", + "integrity": "sha512-U7zJBt0x9aSRuzvYbPUTOfNZQdUXhTKRYAwm6WjL75f7/+UJ64qHFI6KL3klCfLrkqiZx5jaVrSDzfUlJ4ZQJg==", + "requires": { + "@aws-cdk/aws-cloudwatch": "^0.25.2", + "@aws-cdk/aws-iam": "^0.25.2", + "@aws-cdk/cdk": "^0.25.2" + } + }, + "@aws-cdk/aws-s3": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@aws-cdk/aws-s3/-/aws-s3-0.25.2.tgz", + "integrity": "sha512-Y4Po1CYwj7VIPQV3xZcAQpiwvd4+M/eqTHa/y1vgn4P5K6CRjFDiN6UyJG1iD32h5gk79e3Bs59QbBiIPEGAXA==", + "requires": { + "@aws-cdk/aws-codepipeline-api": "^0.25.2", + "@aws-cdk/aws-events": "^0.25.2", + "@aws-cdk/aws-iam": "^0.25.2", + "@aws-cdk/aws-kms": "^0.25.2", + "@aws-cdk/aws-s3-notifications": "^0.25.2", + "@aws-cdk/cdk": "^0.25.2" + } + }, + "@aws-cdk/aws-s3-notifications": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@aws-cdk/aws-s3-notifications/-/aws-s3-notifications-0.25.2.tgz", + "integrity": "sha512-r6vPkDIT83qEMdbOegKoQIwzxBFMaXUuACRNBirP5mdFf96g71SHpk8MQjMgkoWb2qh+HZ6uklVNPHX2KcJ3+w==", + "requires": { + "@aws-cdk/cdk": "^0.25.2" + } + }, + "@aws-cdk/aws-sqs": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@aws-cdk/aws-sqs/-/aws-sqs-0.25.2.tgz", + "integrity": "sha512-7grI6f5VXkYHKiFZJ1eImHlhYtbLcGvoJ0IykOSUP+KW35elGsHOtuBFIA583rHWPDtHKnIXVUGhat0m6AIRYg==", + "requires": { + "@aws-cdk/aws-autoscaling-api": "^0.25.2", + "@aws-cdk/aws-cloudwatch": "^0.25.2", + "@aws-cdk/aws-iam": "^0.25.2", + "@aws-cdk/aws-kms": "^0.25.2", + "@aws-cdk/aws-s3-notifications": "^0.25.2", + "@aws-cdk/cdk": "^0.25.2" + } + }, + "@aws-cdk/aws-stepfunctions": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@aws-cdk/aws-stepfunctions/-/aws-stepfunctions-0.25.2.tgz", + "integrity": "sha512-y0TOkyRTW3ONGr9KFUh47pn/p51Np5eVzz37qe7zZdDuQsbEJH4CMEYV9L2fmt15evMM3Y4qn0qTOvxEPHVQIg==", + "requires": { + "@aws-cdk/aws-cloudwatch": "^0.25.2", + "@aws-cdk/aws-events": "^0.25.2", + "@aws-cdk/aws-iam": "^0.25.2", + "@aws-cdk/cdk": "^0.25.2" + } + }, + "@aws-cdk/cdk": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@aws-cdk/cdk/-/cdk-0.25.2.tgz", + "integrity": "sha512-oJLF50GPFL8zGBxCn5WZdAFEuhx+uXI0egbAsR32aqX3c0a3+SOAL0r/da/iNU7KkFdjUibt3cPSChay77YCvw==", + "requires": { + "@aws-cdk/cx-api": "^0.25.2" + } + }, + "@aws-cdk/cx-api": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@aws-cdk/cx-api/-/cx-api-0.25.2.tgz", + "integrity": "sha512-MHFnldhVYwjEb023PDzyaq1Uh+6Q2by8ZIGoEjEQIhvc3OidgQ6FrRMSgeT0r1wE7c2va7yi+rpPC3MHAkHf9A==" + } + } + }, "@aws-cdk/aws-sqs": { "version": "0.25.0", "resolved": "https://registry.npmjs.org/@aws-cdk/aws-sqs/-/aws-sqs-0.25.0.tgz", @@ -733,7 +1059,17 @@ "data-uri-to-buffer": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-2.0.0.tgz", - "integrity": "sha512-YbKCNLPPP4inc0E5If4OaalBc7gpaM2MRv77Pv2VThVComLKfbGYtJcdDCViDyp1Wd4SebhHLz94vp91zbK6bw==" + "integrity": "sha512-YbKCNLPPP4inc0E5If4OaalBc7gpaM2MRv77Pv2VThVComLKfbGYtJcdDCViDyp1Wd4SebhHLz94vp91zbK6bw==", + "requires": { + "@types/node": "^8.0.7" + }, + "dependencies": { + "@types/node": { + "version": "8.10.43", + "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.43.tgz", + "integrity": "sha512-5m5W13HR2k3cu88mpzlnPBBv5+GyMHtj4F0P83RG4mqoC0AYVYHVMHfF3SgwKNtqEZiZQASMxU92QsLEekKcnw==" + } + } }, "debug": { "version": "3.2.6", diff --git a/aws/package.json b/aws/package.json index 878f641..9307733 100644 --- a/aws/package.json +++ b/aws/package.json @@ -19,8 +19,10 @@ "@types/node": "^11.9.5" }, "dependencies": { + "@aws-cdk/assets": "^0.25.2", "@aws-cdk/aws-apigateway": "^0.25.0", "@aws-cdk/aws-cloudfront": "^0.25.0", + "@aws-cdk/aws-codepipeline": "^0.25.2", "@aws-cdk/aws-lambda": "^0.25.0", "@aws-cdk/aws-s3": "^0.25.0", "@aws-cdk/cdk": "^0.25.0", diff --git a/aws/src/index.ts b/aws/src/index.ts index c90c1a2..67bc0cf 100644 --- a/aws/src/index.ts +++ b/aws/src/index.ts @@ -3,24 +3,67 @@ import { Stack, App, StackProps } from '@aws-cdk/cdk'; import { StaticSite } from './stacks/constructs/static-site'; import { NamedApi } from './stacks/constructs/api'; -class VariableSite extends Stack { + +type DeploymentEnvironment = { + name: string; + region: string[]; +} + +type DeploymentEnvironments = DeploymentEnvironment[]; + +function getEnvironments(): DeploymentEnvironments { + const devCdkEnvironment: DeploymentEnvironment = { + name: 'dev', + region: ['us-west-2', 'us-east-1'] + }; + const stagingCdkEnvironment: DeploymentEnvironment ={ + name: 'staging', + region: ['us-west-2', 'us-east-1'] + }; + const prodCdkEnvironment: DeploymentEnvironment ={ + name: 'prod', + region: ['us-west-2', 'us-east-1'] + }; + const deploymentEnvironments: DeploymentEnvironments = [devCdkEnvironment, stagingCdkEnvironment, prodCdkEnvironment]; + return deploymentEnvironments +} + +// function createStack(deploymentEnvironments): Stack[] { +// const stacks = deploymentEnvironments.map(deploymentEnvironment => +// new StackName(this, ) +// ) + // new NamedApi(this, 'NamedApi', { + // domainName: this.node.getContext('domain'), + // apiPrefix: this.node.getContext('subdomain').apiPrefix + // }); +// } + +class Api extends Stack { constructor(parent: App, name: string, props: StackProps) { super(parent, name, props); + new NamedApi(this, 'NamedApi', { + domainName: this.node.getContext('domain'), + apiPrefix: this.node.getContext('subdomain').apiPrefix + }); + } +} + + +class Site extends Stack { + constructor(parent: App, name: string, props: StackProps) { + super(parent, name, props); // Associate S3 with the domain name new StaticSite(this, 'StaticSite', { domainName: this.node.getContext('domain'), siteSubDomain: this.node.getContext('subdomain').websitePrefix, }); - new NamedApi(this, 'NamedApi', { - domainName: this.node.getContext('domain'), - apiPrefix: this.node.getContext('subdomain').apiPrefix - }); } } const app = new App(); -new VariableSite(app, 'VariableSiteMk1', { env: { region: 'us-east-1' } }); +new Site(app, 'VariableSiteMk1', { env: { region: 'us-east-1' } }); +new Api(app, 'VariableApiMk1', { env: { region: 'us-east-1' } }); app.run(); diff --git a/aws/src/stacks/constructs/api/index.ts b/aws/src/stacks/constructs/api/index.ts index 6648e63..51b5f50 100644 --- a/aws/src/stacks/constructs/api/index.ts +++ b/aws/src/stacks/constructs/api/index.ts @@ -14,14 +14,14 @@ export class NamedApi extends cdk.Construct { constructor(parent: cdk.Construct, name: string, props: NamedApiProps) { super(parent, name); - // START LAM`BDA LOGIC + // START LAMBDA LOGIC // Create S3 bucket for the lambda code const bucket = new s3.Bucket(this, 'WidgetStore'); // Why do I have the feeling I'm about to bump into that // got eeem of the max limit that you can inline for a lambda function const handlerConfig = { runtime: lambda.Runtime.NodeJS810, - code: lambda.Code.directory('resources/widget.js'), + code: lambda.Code.directory('src/resources'), handler: 'widgets.main', environment: { BUCKET: bucket.bucketName diff --git a/aws/src/stacks/constructs/cdk/index.ts b/aws/src/stacks/constructs/cdk/index.ts new file mode 100644 index 0000000..0d77c3c --- /dev/null +++ b/aws/src/stacks/constructs/cdk/index.ts @@ -0,0 +1,41 @@ +#!/usr/bin/env node +import { Construct, Output, TagManager, Tag } from '@aws-cdk/cdk'; +import { Bucket, BlockPublicAccess, BucketEncryption } from '@aws-cdk/aws-s3'; + + +export class TaggedStack extends Stack { + constructor(parent: Construct, name: string, props: TaggedStackProps) { + super(parent, name); + + } +} + +export default function({ key, stack }) { + return +} + + +class CdkEnvironmentBucket extends Construct { + constructor(parent: Construct, name: string, props: CdkEnvironmentBucketProps) { + super(parent, name); + const cdkBucketAccessControl = new BlockPublicAccess({ + blockPublicAcls: true, + blockPublicPolicy: true, + ignorePublicAcls: true, + restrictPublicBuckets: true, + }); + const cdkBucket = new Bucket(this, 'cdkBootstrappedEnvironment', { + encryption: BucketEncryption.Kms, + blockPublicAccess: cdkBucketAccessControl + }); + + new Output(this, 'CdkEnvironmentBucket', { + value: cdkBucket.bucketArn + }); + // export the resource to tag it + const cdkBucketExport = cdkBucket.export(); + + } +} + +// const withTagging = injectTagging({ key: }) \ No newline at end of file diff --git a/aws/src/stacks/constructs/iam/cloudformation-policies.ts b/aws/src/stacks/constructs/iam/cloudformation-policies.ts new file mode 100644 index 0000000..384e744 --- /dev/null +++ b/aws/src/stacks/constructs/iam/cloudformation-policies.ts @@ -0,0 +1,29 @@ +#!/usr/bin/env node +import { Construct } from '@aws-cdk/cdk'; +import { PolicyStatement } from '@aws-cdk/aws-iam'; +import { IBucket } from '@aws-cdk/aws-s3'; + +export interface CloudformationRoleProps { + templateBucket: IBucket +} +export class CloudformationRole extends Construct { + constructor(parent: Construct, name: string, props: CloudformationRoleProps) { + super(parent, name); + const s3Policy = this.createS3BucketPolicy(); + + } + /** + * @name - createS3PolicyStatement + * @description - Do not want an open "new PolicyStatement", so hide it in a private method + */ + protected createS3BucketPolicy(): PolicyStatement { + const s3Policy = new PolicyStatement(); + const s3Actions = ["s3:PutObject", "s3:ListBucket", "s3:GetObject", "s3:CreateBucket"]; + s3Actions.map(s3Action => { + s3Policy.addAction(s3Action); + }); + + console.log(`s3Policy: ${s3Policy}`); + return s3Policy; + } +} \ No newline at end of file diff --git a/aws/src/stacks/constructs/iam/static-site-creation.ts b/aws/src/stacks/constructs/iam/static-site-creation.ts new file mode 100644 index 0000000..e69de29 diff --git a/aws/src/stacks/constructs/logging/format.ts b/aws/src/stacks/constructs/logging/format.ts new file mode 100644 index 0000000..71a2b2c --- /dev/null +++ b/aws/src/stacks/constructs/logging/format.ts @@ -0,0 +1,10 @@ +// static analysis + // ? +// checksums and proofs + // checksum -> + // proofs -> +// durability checks + // durability auditor + // microservice for checking integrity +// operational safeguards + // \ No newline at end of file diff --git a/aws/src/stacks/constructs/logging/index.ts b/aws/src/stacks/constructs/logging/index.ts new file mode 100644 index 0000000..e69de29 diff --git a/aws/src/stacks/constructs/logging/tagging.ts b/aws/src/stacks/constructs/logging/tagging.ts new file mode 100644 index 0000000..28d1523 --- /dev/null +++ b/aws/src/stacks/constructs/logging/tagging.ts @@ -0,0 +1,96 @@ +#!/usr/bin/env node + +// this should be an enum +// but I'm not quite sure how +// to get enums to work correctly +type ApplicationRole = { + apiLayer: "api-layer", + dataLayer: { + metaData: { + buildArtifacts: "build-artifact", + logging: "logging", + }, + data: "primary" + } +}; +// stub +type ArnIdentifier = { + id: string +}; +enum EnvironmentSetting { + production = "PROD", + staging = "STAGING", + development = "DEV", +}; + +type Version = { + major: number, + minor: number, + patch: number +}; + +type ResourceIdentifier = { + id: string +}; + +export interface TechnicalTag { + name: string, + applicationId: string, + applicationRole: ApplicationRole, + cluster: ResourceIdentifier, + environment: EnvironmentSetting, + version: Version +}; + +// time is relative... + +export interface AutomationTag { + resourceLifecycle: { + start: string[], + stop: string[], + delete: string[], + rotate: string[], + }, + managedServices: string[], + security: string[], +}; + + +export interface BusinessTag { + owner: ArnIdentifier, + businessUnit: string[], + customers: string[], + project: string[] +}; + +type ConfidentialityLevel = { + GDPRCompliant: boolean +}; + +type Field = { + name: string +}; +// regulations have: + // names + // scope of affected data +// PCI? GDPR? +type Regulation = { + name: string, + fields: Field[]; +}; +export interface SecurityTagProps { + confidentiality: ConfidentialityLevel + compliance: Regulation[], +}; + +export class SecurityTag { + constructor(props: SecurityTagProps) { + const { confidentiality, compliance } = props; + const securityTag = new SecurityTag({ + confidentiality, + compliance + }); + console.log(`securityTag: ${securityTag}`); + } +} + diff --git a/aws/src/stacks/constructs/static-site/index.ts b/aws/src/stacks/constructs/static-site/index.ts index d2c6f60..ab32f71 100644 --- a/aws/src/stacks/constructs/static-site/index.ts +++ b/aws/src/stacks/constructs/static-site/index.ts @@ -1,8 +1,8 @@ #!/usr/bin/env node -import cloudfront = require('@aws-cdk/aws-cloudfront'); -import route53 = require('@aws-cdk/aws-route53'); -import s3 = require('@aws-cdk/aws-s3'); -import cdk = require('@aws-cdk/cdk'); +import { CloudFrontWebDistribution, SSLMethod, SecurityPolicyProtocol } from '@aws-cdk/aws-cloudfront'; +import { HostedZoneProvider, AliasRecord } from '@aws-cdk/aws-route53'; +import { Bucket } from '@aws-cdk/aws-s3'; +import { Construct, Output, SSMParameterProvider } from '@aws-cdk/cdk'; export interface StaticSiteProps { domainName: string; @@ -18,33 +18,50 @@ export interface StaticSiteProps { * The ACM certificate is expected to be created and validated outside of the CDK, * with the certificate ARN stored in an SSM Parameter. */ -export class StaticSite extends cdk.Construct { - constructor(parent: cdk.Construct, name: string, props: StaticSiteProps) { +export class StaticSite extends Construct { + constructor(parent: Construct, name: string, props: StaticSiteProps) { super(parent, name); + const { siteSubDomain, domainName } = props; + const siteDomain = `${siteSubDomain}.${domainName}`; - const siteDomain = props.siteSubDomain + '.' + props.domainName; + // create s3 bucket + const s3Bucket = this.createSiteBucket(siteSubDomain, domainName); + const s3Output = new Output(this, 'SiteBucket', { + value: s3Bucket.bucketName + }); + + // Create cloudfront distribution + const cloudFrontDistribution = this.createCloudFrontDistribution(siteDomain, s3Bucket); + new Output(this, 'DistributionId', { value: cloudFrontDistribution }); + + // Alias Record for cloudfront distribution + this.createAliasRecord(domainName, siteDomain, cloudFrontDistribution); + } + protected createSiteBucket(siteSubDomain: string, domainName: string): Bucket { + const siteDomain = siteSubDomain + '.' + domainName; // Content bucket - const siteBucket = new s3.Bucket(this, 'SiteBucket', { + const bucket = new Bucket(this, 'SiteBucket', { bucketName: siteDomain, websiteIndexDocument: 'index.html', websiteErrorDocument: 'error.html', publicReadAccess: true }); - new cdk.Output(this, 'Bucket', { value: siteBucket.bucketName }); - - // Pre-existing ACM certificate, with the ARN stored in an SSM Parameter - const certificateArn = new cdk.SSMParameterProvider(this, { - parameterName: 'CertificateArn-' + siteDomain - }).parameterValue(); - + return bucket; + } + protected createCloudFrontDistribution(siteDomain: string, siteBucket: Bucket): CloudFrontWebDistribution { // CloudFront distribution that provides HTTPS - const distribution = new cloudfront.CloudFrontWebDistribution(this, 'SiteDistribution', { + const ssmParameterProviderConfig = { + parameterName: `CertificateArn-${siteDomain}` + }; + // Pre-existing ACM certificate, with the ARN stored in an SSM Parameter + const certificateArn = new SSMParameterProvider(this, ssmParameterProviderConfig).parameterValue(); + const distribution = new CloudFrontWebDistribution(this, 'SiteDistribution', { aliasConfiguration: { acmCertRef: certificateArn, names: [ siteDomain ], - sslMethod: cloudfront.SSLMethod.SNI, - securityPolicy: cloudfront.SecurityPolicyProtocol.TLSv1_1_2016 + sslMethod: SSLMethod.SNI, + securityPolicy: SecurityPolicyProtocol.TLSv1_1_2016 }, originConfigs: [ { @@ -55,14 +72,18 @@ export class StaticSite extends cdk.Construct { } ] }); - new cdk.Output(this, 'DistributionId', { value: distribution.distributionId }); - + return distribution; + } + protected createAliasRecord(domainName: string, siteDomain: string, distributionValue: CloudFrontWebDistribution ) { // Route53 alias record for the CloudFront distribution - const zone = new route53.HostedZoneProvider(this, { domainName: props.domainName }).findAndImport(this, 'Zone'); - new route53.AliasRecord(this, 'SiteAliasRecord', { + const zone = new HostedZoneProvider(this, { domainName: domainName }).findAndImport(this, 'Zone'); + const aliasRecord = new AliasRecord(this, 'SiteAliasRecord', { recordName: siteDomain, - target: distribution, + target: distributionValue, zone }); } -} \ No newline at end of file + +} + + diff --git a/aws/template-output/VariableApiMk1.template.yaml b/aws/template-output/VariableApiMk1.template.yaml new file mode 100644 index 0000000..d819e40 --- /dev/null +++ b/aws/template-output/VariableApiMk1.template.yaml @@ -0,0 +1,445 @@ +Resources: + NamedApiWidgetStore5266C165: + Type: AWS::S3::Bucket + DeletionPolicy: Retain + Metadata: + aws:cdk:path: VariableApiMk1/NamedApi/WidgetStore/Resource + NamedApiWidgetHandlerServiceRole875A954D: + Type: AWS::IAM::Role + Properties: + AssumeRolePolicyDocument: + Statement: + - Action: sts:AssumeRole + Effect: Allow + Principal: + Service: lambda.amazonaws.com + Version: "2012-10-17" + ManagedPolicyArns: + - Fn::Join: + - "" + - - "arn:" + - Ref: AWS::Partition + - :iam::aws:policy/service-role/AWSLambdaBasicExecutionRole + Metadata: + aws:cdk:path: VariableApiMk1/NamedApi/WidgetHandler/ServiceRole/Resource + NamedApiWidgetHandlerServiceRoleDefaultPolicy758AA183: + Type: AWS::IAM::Policy + Properties: + PolicyDocument: + Statement: + - Action: + - s3:GetObject* + - s3:GetBucket* + - s3:List* + - s3:DeleteObject* + - s3:PutObject* + - s3:Abort* + Effect: Allow + Resource: + - Fn::GetAtt: + - NamedApiWidgetStore5266C165 + - Arn + - Fn::Join: + - "" + - - Fn::GetAtt: + - NamedApiWidgetStore5266C165 + - Arn + - /* + Version: "2012-10-17" + PolicyName: NamedApiWidgetHandlerServiceRoleDefaultPolicy758AA183 + Roles: + - Ref: NamedApiWidgetHandlerServiceRole875A954D + Metadata: + aws:cdk:path: VariableApiMk1/NamedApi/WidgetHandler/ServiceRole/DefaultPolicy/Resource + NamedApiWidgetHandlerF81C1DDE: + Type: AWS::Lambda::Function + Properties: + Code: + S3Bucket: + Ref: NamedApiWidgetHandlerCodeS3BucketB8C6072D + S3Key: + Fn::Join: + - "" + - - Fn::Select: + - 0 + - Fn::Split: + - "||" + - Ref: NamedApiWidgetHandlerCodeS3VersionKeyE94F3887 + - Fn::Select: + - 1 + - Fn::Split: + - "||" + - Ref: NamedApiWidgetHandlerCodeS3VersionKeyE94F3887 + Handler: widgets.main + Role: + Fn::GetAtt: + - NamedApiWidgetHandlerServiceRole875A954D + - Arn + Runtime: nodejs8.10 + Environment: + Variables: + BUCKET: + Ref: NamedApiWidgetStore5266C165 + DependsOn: + - NamedApiWidgetHandlerServiceRoleDefaultPolicy758AA183 + - NamedApiWidgetHandlerServiceRole875A954D + Metadata: + aws:cdk:path: VariableApiMk1/NamedApi/WidgetHandler/Resource + aws:asset:path: C:\Users\Andres\Desktop\Programming\professional\variable-site\aws\src\resources + aws:asset:property: Code + NamedApiWidgetHandlerApiPermissionGETD964885D: + Type: AWS::Lambda::Permission + Properties: + Action: lambda:InvokeFunction + FunctionName: + Ref: NamedApiWidgetHandlerF81C1DDE + Principal: apigateway.amazonaws.com + SourceArn: + Fn::Join: + - "" + - - "arn:" + - Ref: AWS::Partition + - ":execute-api:us-east-1:985713782822:" + - Ref: NamedApiwidgetsapiF2A60F63 + - / + - Ref: NamedApiwidgetsapiDeploymentStageprodB91BB64F + - /GET/ + Metadata: + aws:cdk:path: VariableApiMk1/NamedApi/WidgetHandler/ApiPermission.GET.. + NamedApiWidgetHandlerApiPermissionTestGET30B944A4: + Type: AWS::Lambda::Permission + Properties: + Action: lambda:InvokeFunction + FunctionName: + Ref: NamedApiWidgetHandlerF81C1DDE + Principal: apigateway.amazonaws.com + SourceArn: + Fn::Join: + - "" + - - "arn:" + - Ref: AWS::Partition + - ":execute-api:us-east-1:985713782822:" + - Ref: NamedApiwidgetsapiF2A60F63 + - /test-invoke-stage/GET/ + Metadata: + aws:cdk:path: VariableApiMk1/NamedApi/WidgetHandler/ApiPermission.Test.GET.. + NamedApiWidgetHandlerApiPermissionPOSTid50B94699: + Type: AWS::Lambda::Permission + Properties: + Action: lambda:InvokeFunction + FunctionName: + Ref: NamedApiWidgetHandlerF81C1DDE + Principal: apigateway.amazonaws.com + SourceArn: + Fn::Join: + - "" + - - "arn:" + - Ref: AWS::Partition + - ":execute-api:us-east-1:985713782822:" + - Ref: NamedApiwidgetsapiF2A60F63 + - / + - Ref: NamedApiwidgetsapiDeploymentStageprodB91BB64F + - /POST/{id} + Metadata: + aws:cdk:path: VariableApiMk1/NamedApi/WidgetHandler/ApiPermission.POST..{id} + NamedApiWidgetHandlerApiPermissionTestPOSTid040CA39F: + Type: AWS::Lambda::Permission + Properties: + Action: lambda:InvokeFunction + FunctionName: + Ref: NamedApiWidgetHandlerF81C1DDE + Principal: apigateway.amazonaws.com + SourceArn: + Fn::Join: + - "" + - - "arn:" + - Ref: AWS::Partition + - ":execute-api:us-east-1:985713782822:" + - Ref: NamedApiwidgetsapiF2A60F63 + - /test-invoke-stage/POST/{id} + Metadata: + aws:cdk:path: VariableApiMk1/NamedApi/WidgetHandler/ApiPermission.Test.POST..{id} + NamedApiWidgetHandlerApiPermissionGETid6956B510: + Type: AWS::Lambda::Permission + Properties: + Action: lambda:InvokeFunction + FunctionName: + Ref: NamedApiWidgetHandlerF81C1DDE + Principal: apigateway.amazonaws.com + SourceArn: + Fn::Join: + - "" + - - "arn:" + - Ref: AWS::Partition + - ":execute-api:us-east-1:985713782822:" + - Ref: NamedApiwidgetsapiF2A60F63 + - / + - Ref: NamedApiwidgetsapiDeploymentStageprodB91BB64F + - /GET/{id} + Metadata: + aws:cdk:path: VariableApiMk1/NamedApi/WidgetHandler/ApiPermission.GET..{id} + NamedApiWidgetHandlerApiPermissionTestGETid5CD2F2BF: + Type: AWS::Lambda::Permission + Properties: + Action: lambda:InvokeFunction + FunctionName: + Ref: NamedApiWidgetHandlerF81C1DDE + Principal: apigateway.amazonaws.com + SourceArn: + Fn::Join: + - "" + - - "arn:" + - Ref: AWS::Partition + - ":execute-api:us-east-1:985713782822:" + - Ref: NamedApiwidgetsapiF2A60F63 + - /test-invoke-stage/GET/{id} + Metadata: + aws:cdk:path: VariableApiMk1/NamedApi/WidgetHandler/ApiPermission.Test.GET..{id} + NamedApiWidgetHandlerApiPermissionDELETEid4126607C: + Type: AWS::Lambda::Permission + Properties: + Action: lambda:InvokeFunction + FunctionName: + Ref: NamedApiWidgetHandlerF81C1DDE + Principal: apigateway.amazonaws.com + SourceArn: + Fn::Join: + - "" + - - "arn:" + - Ref: AWS::Partition + - ":execute-api:us-east-1:985713782822:" + - Ref: NamedApiwidgetsapiF2A60F63 + - / + - Ref: NamedApiwidgetsapiDeploymentStageprodB91BB64F + - /DELETE/{id} + Metadata: + aws:cdk:path: VariableApiMk1/NamedApi/WidgetHandler/ApiPermission.DELETE..{id} + NamedApiWidgetHandlerApiPermissionTestDELETEid60C2950A: + Type: AWS::Lambda::Permission + Properties: + Action: lambda:InvokeFunction + FunctionName: + Ref: NamedApiWidgetHandlerF81C1DDE + Principal: apigateway.amazonaws.com + SourceArn: + Fn::Join: + - "" + - - "arn:" + - Ref: AWS::Partition + - ":execute-api:us-east-1:985713782822:" + - Ref: NamedApiwidgetsapiF2A60F63 + - /test-invoke-stage/DELETE/{id} + Metadata: + aws:cdk:path: VariableApiMk1/NamedApi/WidgetHandler/ApiPermission.Test.DELETE..{id} + NamedApiwidgetsapiF2A60F63: + Type: AWS::ApiGateway::RestApi + Properties: + Description: This service serves widgets + Name: Widget Service + Metadata: + aws:cdk:path: VariableApiMk1/NamedApi/widgets-api/Resource + NamedApiwidgetsapiDeployment234D94E69dfcda262950f71a4d457f10c2d7a929: + Type: AWS::ApiGateway::Deployment + Properties: + RestApiId: + Ref: NamedApiwidgetsapiF2A60F63 + Description: Automatically created by the RestApi construct + DependsOn: + - NamedApiwidgetsapiidDELETEFE56CE86 + - NamedApiwidgetsapiidGET938FAF93 + - NamedApiwidgetsapiidPOSTBA970FC6 + - NamedApiwidgetsapiidFE8D9B40 + - NamedApiwidgetsapiGET948C58F4 + Metadata: + aws:cdk:path: VariableApiMk1/NamedApi/widgets-api/Deployment/Resource + NamedApiwidgetsapiDeploymentStageprodB91BB64F: + Type: AWS::ApiGateway::Stage + Properties: + RestApiId: + Ref: NamedApiwidgetsapiF2A60F63 + DeploymentId: + Ref: NamedApiwidgetsapiDeployment234D94E69dfcda262950f71a4d457f10c2d7a929 + StageName: prod + Metadata: + aws:cdk:path: VariableApiMk1/NamedApi/widgets-api/DeploymentStage.prod/Resource + NamedApiwidgetsapiCloudWatchRole3DDC513B: + Type: AWS::IAM::Role + Properties: + AssumeRolePolicyDocument: + Statement: + - Action: sts:AssumeRole + Effect: Allow + Principal: + Service: apigateway.amazonaws.com + Version: "2012-10-17" + ManagedPolicyArns: + - Fn::Join: + - "" + - - "arn:" + - Ref: AWS::Partition + - :iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs + Metadata: + aws:cdk:path: VariableApiMk1/NamedApi/widgets-api/CloudWatchRole/Resource + NamedApiwidgetsapiAccount1226F0ED: + Type: AWS::ApiGateway::Account + Properties: + CloudWatchRoleArn: + Fn::GetAtt: + - NamedApiwidgetsapiCloudWatchRole3DDC513B + - Arn + DependsOn: + - NamedApiwidgetsapiF2A60F63 + Metadata: + aws:cdk:path: VariableApiMk1/NamedApi/widgets-api/Account + NamedApiwidgetsapiGET948C58F4: + Type: AWS::ApiGateway::Method + Properties: + HttpMethod: GET + ResourceId: + Fn::GetAtt: + - NamedApiwidgetsapiF2A60F63 + - RootResourceId + RestApiId: + Ref: NamedApiwidgetsapiF2A60F63 + AuthorizationType: NONE + Integration: + IntegrationHttpMethod: POST + RequestTemplates: + application/json: '{ "statusCode": "200" }' + Type: AWS_PROXY + Uri: + Fn::Join: + - "" + - - "arn:" + - Ref: AWS::Partition + - :apigateway:us-east-1:lambda:path/2015-03-31/functions/ + - Fn::GetAtt: + - NamedApiWidgetHandlerF81C1DDE + - Arn + - /invocations + Metadata: + aws:cdk:path: VariableApiMk1/NamedApi/widgets-api/Default/GET/Resource + NamedApiwidgetsapiidFE8D9B40: + Type: AWS::ApiGateway::Resource + Properties: + ParentId: + Fn::GetAtt: + - NamedApiwidgetsapiF2A60F63 + - RootResourceId + PathPart: "{id}" + RestApiId: + Ref: NamedApiwidgetsapiF2A60F63 + Metadata: + aws:cdk:path: VariableApiMk1/NamedApi/widgets-api/Default/{id}/Resource + NamedApiwidgetsapiidPOSTBA970FC6: + Type: AWS::ApiGateway::Method + Properties: + HttpMethod: POST + ResourceId: + Ref: NamedApiwidgetsapiidFE8D9B40 + RestApiId: + Ref: NamedApiwidgetsapiF2A60F63 + AuthorizationType: NONE + Integration: + IntegrationHttpMethod: POST + Type: AWS_PROXY + Uri: + Fn::Join: + - "" + - - "arn:" + - Ref: AWS::Partition + - :apigateway:us-east-1:lambda:path/2015-03-31/functions/ + - Fn::GetAtt: + - NamedApiWidgetHandlerF81C1DDE + - Arn + - /invocations + Metadata: + aws:cdk:path: VariableApiMk1/NamedApi/widgets-api/Default/{id}/POST/Resource + NamedApiwidgetsapiidGET938FAF93: + Type: AWS::ApiGateway::Method + Properties: + HttpMethod: GET + ResourceId: + Ref: NamedApiwidgetsapiidFE8D9B40 + RestApiId: + Ref: NamedApiwidgetsapiF2A60F63 + AuthorizationType: NONE + Integration: + IntegrationHttpMethod: POST + Type: AWS_PROXY + Uri: + Fn::Join: + - "" + - - "arn:" + - Ref: AWS::Partition + - :apigateway:us-east-1:lambda:path/2015-03-31/functions/ + - Fn::GetAtt: + - NamedApiWidgetHandlerF81C1DDE + - Arn + - /invocations + Metadata: + aws:cdk:path: VariableApiMk1/NamedApi/widgets-api/Default/{id}/GET/Resource + NamedApiwidgetsapiidDELETEFE56CE86: + Type: AWS::ApiGateway::Method + Properties: + HttpMethod: DELETE + ResourceId: + Ref: NamedApiwidgetsapiidFE8D9B40 + RestApiId: + Ref: NamedApiwidgetsapiF2A60F63 + AuthorizationType: NONE + Integration: + IntegrationHttpMethod: POST + Type: AWS_PROXY + Uri: + Fn::Join: + - "" + - - "arn:" + - Ref: AWS::Partition + - :apigateway:us-east-1:lambda:path/2015-03-31/functions/ + - Fn::GetAtt: + - NamedApiWidgetHandlerF81C1DDE + - Arn + - /invocations + Metadata: + aws:cdk:path: VariableApiMk1/NamedApi/widgets-api/Default/{id}/DELETE/Resource + NamedApiSiteAliasRecord3FA49CD2: + Type: AWS::Route53::RecordSet + Properties: + Name: api.wakemygameup.com. + Type: CNAME + HostedZoneId: /hostedzone/Z2LN05VHV1XSN1 + ResourceRecords: + - Fn::Join: + - "" + - - "arn:" + - Ref: AWS::Partition + - ":execute-api:us-east-1:985713782822:" + - Ref: NamedApiwidgetsapiF2A60F63 + - /*/GET/ + TTL: "1800" + Metadata: + aws:cdk:path: VariableApiMk1/NamedApi/SiteAliasRecord/Resource + CDKMetadata: + Type: AWS::CDK::Metadata + Properties: + Modules: aws-cdk=0.25.0,@aws-cdk/assets=0.25.2,@aws-cdk/aws-apigateway=0.25.0,@aws-cdk/aws-cloudfront=0.25.0,@aws-cdk/aws-cloudwatch=0.25.0,@aws-cdk/aws-codepipeline-api=0.25.2,@aws-cdk/aws-ec2=0.25.0,@aws-cdk/aws-events=0.25.2,@aws-cdk/aws-iam=0.25.2,@aws-cdk/aws-kms=0.25.2,@aws-cdk/aws-lambda=0.25.0,@aws-cdk/aws-route53=0.25.0,@aws-cdk/aws-s3=0.25.2,@aws-cdk/aws-s3-notifications=0.25.2,@aws-cdk/aws-sqs=0.25.0,@aws-cdk/cdk=0.25.0,@aws-cdk/cx-api=0.25.2,jsii-runtime=node.js/v10.15.2 +Parameters: + NamedApiWidgetHandlerCodeS3BucketB8C6072D: + Type: String + Description: S3 bucket for asset "VariableApiMk1/NamedApi/WidgetHandler/Code" + NamedApiWidgetHandlerCodeS3VersionKeyE94F3887: + Type: String + Description: S3 key for asset version "VariableApiMk1/NamedApi/WidgetHandler/Code" +Outputs: + NamedApiwidgetsapiEndpoint69D10BE9: + Value: + Fn::Join: + - "" + - - https:// + - Ref: NamedApiwidgetsapiF2A60F63 + - .execute-api.us-east-1. + - Ref: AWS::URLSuffix + - / + - Ref: NamedApiwidgetsapiDeploymentStageprodB91BB64F + - / diff --git a/aws/template-output/VariableSiteMk1.template.yaml b/aws/template-output/VariableSiteMk1.template.yaml new file mode 100644 index 0000000..bd1ef27 --- /dev/null +++ b/aws/template-output/VariableSiteMk1.template.yaml @@ -0,0 +1,94 @@ +Resources: + StaticSiteSiteBucket1A888BC8: + Type: AWS::S3::Bucket + Properties: + BucketName: www.wakemygameup.com + WebsiteConfiguration: + ErrorDocument: error.html + IndexDocument: index.html + DeletionPolicy: Retain + Metadata: + aws:cdk:path: VariableSiteMk1/StaticSite/SiteBucket/Resource + StaticSiteSiteBucketPolicyD7934718: + Type: AWS::S3::BucketPolicy + Properties: + Bucket: + Ref: StaticSiteSiteBucket1A888BC8 + PolicyDocument: + Statement: + - Action: s3:GetObject + Effect: Allow + Principal: "*" + Resource: + Fn::Join: + - "" + - - Fn::GetAtt: + - StaticSiteSiteBucket1A888BC8 + - Arn + - /* + Version: "2012-10-17" + Metadata: + aws:cdk:path: VariableSiteMk1/StaticSite/SiteBucket/Policy/Resource + StaticSiteSiteDistributionCFDistribution500D676B: + Type: AWS::CloudFront::Distribution + Properties: + DistributionConfig: + Aliases: + - www.wakemygameup.com + CacheBehaviors: [] + DefaultCacheBehavior: + AllowedMethods: + - GET + - HEAD + CachedMethods: + - GET + - HEAD + ForwardedValues: + Cookies: + Forward: none + QueryString: false + TargetOriginId: origin1 + ViewerProtocolPolicy: redirect-to-https + DefaultRootObject: index.html + Enabled: true + HttpVersion: http2 + IPV6Enabled: true + Origins: + - DomainName: + Fn::GetAtt: + - StaticSiteSiteBucket1A888BC8 + - DomainName + Id: origin1 + S3OriginConfig: {} + PriceClass: PriceClass_100 + ViewerCertificate: + AcmCertificateArn: arn:aws:acm:us-east-1:985713782822:certificate/092c0295-caf5-4944-80b2-3263b6b63392 + MinimumProtocolVersion: TLSv1.1_2016 + SslSupportMethod: sni-only + Metadata: + aws:cdk:path: VariableSiteMk1/StaticSite/SiteDistribution/CFDistribution + StaticSiteSiteAliasRecord5B525E22: + Type: AWS::Route53::RecordSet + Properties: + Name: www.wakemygameup.com. + Type: A + AliasTarget: + DNSName: + Fn::GetAtt: + - StaticSiteSiteDistributionCFDistribution500D676B + - DomainName + HostedZoneId: Z2FDTNDATAQYW2 + HostedZoneId: /hostedzone/Z2LN05VHV1XSN1 + Metadata: + aws:cdk:path: VariableSiteMk1/StaticSite/SiteAliasRecord/Resource + CDKMetadata: + Type: AWS::CDK::Metadata + Properties: + Modules: aws-cdk=0.25.0,@aws-cdk/assets=0.25.2,@aws-cdk/aws-apigateway=0.25.0,@aws-cdk/aws-cloudfront=0.25.0,@aws-cdk/aws-cloudwatch=0.25.0,@aws-cdk/aws-codepipeline-api=0.25.2,@aws-cdk/aws-ec2=0.25.0,@aws-cdk/aws-events=0.25.2,@aws-cdk/aws-iam=0.25.2,@aws-cdk/aws-kms=0.25.2,@aws-cdk/aws-lambda=0.25.0,@aws-cdk/aws-route53=0.25.0,@aws-cdk/aws-s3=0.25.2,@aws-cdk/aws-s3-notifications=0.25.2,@aws-cdk/aws-sqs=0.25.0,@aws-cdk/cdk=0.25.0,@aws-cdk/cx-api=0.25.2,jsii-runtime=node.js/v10.15.2 +Outputs: + StaticSiteBucket34E5D9AF: + Value: + Ref: StaticSiteSiteBucket1A888BC8 + StaticSiteDistributionId8C64EF2A: + Value: + Ref: StaticSiteSiteDistributionCFDistribution500D676B