Resources: LambdaInvokeAutoScalingServiceRole66FE839B: 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: autoscaling-update/LambdaInvokeAutoScaling/ServiceRole/Resource LambdaInvokeAutoScaling34D0A3D0: Type: AWS::Lambda::Function Properties: Code: S3Bucket: Ref: AssetParameters542322311cf5b080f91ac2277149612efec51045c1aa6d8ff501a32aae709c7dS3BUCKETINFO S3Key: Fn::Join: - "" - - Fn::Select: - 0 - Fn::Split: - "||" - Ref: AssetParameters542322311cf5b080f91ac2277149612efec51045c1aa6d8ff501a32aae709c7dS3BUCKETINFO - Fn::Select: - 1 - Fn::Split: - "||" - Ref: AssetParameters542322311cf5b080f91ac2277149612efec51045c1aa6d8ff501a32aae709c7dS3BUCKETINFO Handler: update_ami.handler Role: Fn::GetAtt: - LambdaInvokeAutoScalingServiceRole66FE839B - Arn Runtime: python3.7 Description: lambda used to invoke the autoscaling update stepfunction FunctionName: InvokeAutoScaling MemorySize: 256 Timeout: 900 DependsOn: - LambdaInvokeAutoScalingServiceRole66FE839B Metadata: aws:cdk:path: autoscaling-update/LambdaInvokeAutoScaling/Resource aws:asset:path: asset.542322311cf5b080f91ac2277149612efec51045c1aa6d8ff501a32aae709c7d aws:asset:property: Code LambdaApiAuthorizerServiceRole3795E8D0: 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: autoscaling-update/LambdaApiAuthorizer/ServiceRole/Resource LambdaApiAuthorizer041A6040: Type: AWS::Lambda::Function Properties: Code: S3Bucket: Ref: AssetParameters542322311cf5b080f91ac2277149612efec51045c1aa6d8ff501a32aae709c7dS3BUCKETINFO S3Key: Fn::Join: - "" - - Fn::Select: - 0 - Fn::Split: - "||" - Ref: AssetParameters542322311cf5b080f91ac2277149612efec51045c1aa6d8ff501a32aae709c7dS3BUCKETINFO - Fn::Select: - 1 - Fn::Split: - "||" - Ref: AssetParameters542322311cf5b080f91ac2277149612efec51045c1aa6d8ff501a32aae709c7dS3BUCKETINFO Handler: api_authorizer.handler Role: Fn::GetAtt: - LambdaApiAuthorizerServiceRole3795E8D0 - Arn Runtime: python3.7 Description: lambda blue print used to filter authentication with token and API FunctionName: api_authorizer_test MemorySize: 256 Timeout: 900 DependsOn: - LambdaApiAuthorizerServiceRole3795E8D0 Metadata: aws:cdk:path: autoscaling-update/LambdaApiAuthorizer/Resource aws:asset:path: asset.542322311cf5b080f91ac2277149612efec51045c1aa6d8ff501a32aae709c7d aws:asset:property: Code APIGWAutoscalingUpdateConf622FBC28: Type: AWS::ApiGateway::RestApi Properties: ApiKeySourceType: AUTHORIZER Name: autoscaling-api Metadata: aws:cdk:path: autoscaling-update/APIGWAutoscalingUpdateConf/Resource APIGWAutoscalingUpdateConfDeployment94F341B739a0dd9224bd046256b8aaea35e99674: Type: AWS::ApiGateway::Deployment Properties: RestApiId: Ref: APIGWAutoscalingUpdateConf622FBC28 Description: Automatically created by the RestApi construct DependsOn: - APIGWAutoscalingUpdateConfautoscalingupdateGETD89CA2FC - APIGWAutoscalingUpdateConfautoscalingupdatePOSTED942890 - APIGWAutoscalingUpdateConfautoscalingupdateA92E0778 Metadata: aws:cdk:path: autoscaling-update/APIGWAutoscalingUpdateConf/Deployment/Resource APIGWAutoscalingUpdateConfDeploymentStageprod21EA514A: Type: AWS::ApiGateway::Stage Properties: RestApiId: Ref: APIGWAutoscalingUpdateConf622FBC28 DeploymentId: Ref: APIGWAutoscalingUpdateConfDeployment94F341B739a0dd9224bd046256b8aaea35e99674 StageName: prod Metadata: aws:cdk:path: autoscaling-update/APIGWAutoscalingUpdateConf/DeploymentStage.prod/Resource APIGWAutoscalingUpdateConfCloudWatchRoleA7C65BCC: 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: autoscaling-update/APIGWAutoscalingUpdateConf/CloudWatchRole/Resource APIGWAutoscalingUpdateConfAccount4D8E9868: Type: AWS::ApiGateway::Account Properties: CloudWatchRoleArn: Fn::GetAtt: - APIGWAutoscalingUpdateConfCloudWatchRoleA7C65BCC - Arn DependsOn: - APIGWAutoscalingUpdateConf622FBC28 Metadata: aws:cdk:path: autoscaling-update/APIGWAutoscalingUpdateConf/Account APIGWAutoscalingUpdateConfautoscalingupdateA92E0778: Type: AWS::ApiGateway::Resource Properties: ParentId: Fn::GetAtt: - APIGWAutoscalingUpdateConf622FBC28 - RootResourceId PathPart: autoscaling_update RestApiId: Ref: APIGWAutoscalingUpdateConf622FBC28 Metadata: aws:cdk:path: autoscaling-update/APIGWAutoscalingUpdateConf/Default/autoscaling_update/Resource APIGWAutoscalingUpdateConfautoscalingupdateGETApiPermissionautoscalingupdateAPIGWAutoscalingUpdateConf09694B9DGETautoscalingupdate848B11D5: Type: AWS::Lambda::Permission Properties: Action: lambda:InvokeFunction FunctionName: Fn::GetAtt: - LambdaInvokeAutoScaling34D0A3D0 - Arn Principal: apigateway.amazonaws.com SourceArn: Fn::Join: - "" - - "arn:" - Ref: AWS::Partition - ":execute-api:eu-west-1:000000000000:" - Ref: APIGWAutoscalingUpdateConf622FBC28 - / - Ref: APIGWAutoscalingUpdateConfDeploymentStageprod21EA514A - /GET/autoscaling_update Metadata: aws:cdk:path: autoscaling-update/APIGWAutoscalingUpdateConf/Default/autoscaling_update/GET/ApiPermission.autoscalingupdateAPIGWAutoscalingUpdateConf09694B9D.GET..autoscaling_update APIGWAutoscalingUpdateConfautoscalingupdateGETApiPermissionTestautoscalingupdateAPIGWAutoscalingUpdateConf09694B9DGETautoscalingupdate152846A5: Type: AWS::Lambda::Permission Properties: Action: lambda:InvokeFunction FunctionName: Fn::GetAtt: - LambdaInvokeAutoScaling34D0A3D0 - Arn Principal: apigateway.amazonaws.com SourceArn: Fn::Join: - "" - - "arn:" - Ref: AWS::Partition - ":execute-api:eu-west-1:000000000000:" - Ref: APIGWAutoscalingUpdateConf622FBC28 - /test-invoke-stage/GET/autoscaling_update Metadata: aws:cdk:path: autoscaling-update/APIGWAutoscalingUpdateConf/Default/autoscaling_update/GET/ApiPermission.Test.autoscalingupdateAPIGWAutoscalingUpdateConf09694B9D.GET..autoscaling_update APIGWAutoscalingUpdateConfautoscalingupdateGETD89CA2FC: Type: AWS::ApiGateway::Method Properties: HttpMethod: GET ResourceId: Ref: APIGWAutoscalingUpdateConfautoscalingupdateA92E0778 RestApiId: Ref: APIGWAutoscalingUpdateConf622FBC28 AuthorizationType: NONE Integration: IntegrationHttpMethod: POST Type: AWS_PROXY Uri: Fn::Join: - "" - - "arn:" - Ref: AWS::Partition - :apigateway:eu-west-1:lambda:path/2015-03-31/functions/ - Fn::GetAtt: - LambdaInvokeAutoScaling34D0A3D0 - Arn - /invocations Metadata: aws:cdk:path: autoscaling-update/APIGWAutoscalingUpdateConf/Default/autoscaling_update/GET/Resource APIGWAutoscalingUpdateConfautoscalingupdatePOSTApiPermissionautoscalingupdateAPIGWAutoscalingUpdateConf09694B9DPOSTautoscalingupdate1F289624: Type: AWS::Lambda::Permission Properties: Action: lambda:InvokeFunction FunctionName: Fn::GetAtt: - LambdaInvokeAutoScaling34D0A3D0 - Arn Principal: apigateway.amazonaws.com SourceArn: Fn::Join: - "" - - "arn:" - Ref: AWS::Partition - ":execute-api:eu-west-1:000000000000:" - Ref: APIGWAutoscalingUpdateConf622FBC28 - / - Ref: APIGWAutoscalingUpdateConfDeploymentStageprod21EA514A - /POST/autoscaling_update Metadata: aws:cdk:path: autoscaling-update/APIGWAutoscalingUpdateConf/Default/autoscaling_update/POST/ApiPermission.autoscalingupdateAPIGWAutoscalingUpdateConf09694B9D.POST..autoscaling_update APIGWAutoscalingUpdateConfautoscalingupdatePOSTApiPermissionTestautoscalingupdateAPIGWAutoscalingUpdateConf09694B9DPOSTautoscalingupdateAA04EDCF: Type: AWS::Lambda::Permission Properties: Action: lambda:InvokeFunction FunctionName: Fn::GetAtt: - LambdaInvokeAutoScaling34D0A3D0 - Arn Principal: apigateway.amazonaws.com SourceArn: Fn::Join: - "" - - "arn:" - Ref: AWS::Partition - ":execute-api:eu-west-1:000000000000:" - Ref: APIGWAutoscalingUpdateConf622FBC28 - /test-invoke-stage/POST/autoscaling_update Metadata: aws:cdk:path: autoscaling-update/APIGWAutoscalingUpdateConf/Default/autoscaling_update/POST/ApiPermission.Test.autoscalingupdateAPIGWAutoscalingUpdateConf09694B9D.POST..autoscaling_update APIGWAutoscalingUpdateConfautoscalingupdatePOSTED942890: Type: AWS::ApiGateway::Method Properties: HttpMethod: POST ResourceId: Ref: APIGWAutoscalingUpdateConfautoscalingupdateA92E0778 RestApiId: Ref: APIGWAutoscalingUpdateConf622FBC28 AuthorizationType: CUSTOM Integration: IntegrationHttpMethod: POST Type: AWS_PROXY Uri: Fn::Join: - "" - - "arn:" - Ref: AWS::Partition - :apigateway:eu-west-1:lambda:path/2015-03-31/functions/ - Fn::GetAtt: - LambdaInvokeAutoScaling34D0A3D0 - Arn - /invocations Metadata: aws:cdk:path: autoscaling-update/APIGWAutoscalingUpdateConf/Default/autoscaling_update/POST/Resource APIGWAutoscalingUpdateConftestkey1392D3AF: Type: AWS::ApiGateway::ApiKey Properties: Enabled: true StageKeys: - RestApiId: Ref: APIGWAutoscalingUpdateConf622FBC28 StageName: Ref: APIGWAutoscalingUpdateConfDeploymentStageprod21EA514A Metadata: aws:cdk:path: autoscaling-update/APIGWAutoscalingUpdateConf/test_key/Resource APIGWAutoscalingUpdateConfautoscalingusageplanBB4A49A7: Type: AWS::ApiGateway::UsagePlan Properties: ApiStages: - ApiId: Ref: APIGWAutoscalingUpdateConf622FBC28 Stage: Ref: APIGWAutoscalingUpdateConfDeploymentStageprod21EA514A Throttle: {} Metadata: aws:cdk:path: autoscaling-update/APIGWAutoscalingUpdateConf/autoscalingusageplan/Resource APIGWAutoscalingUpdateConfautoscalingusageplanUsagePlanKeyResourceB5A3FCCF: Type: AWS::ApiGateway::UsagePlanKey Properties: KeyId: Ref: APIGWAutoscalingUpdateConftestkey1392D3AF KeyType: API_KEY UsagePlanId: Ref: APIGWAutoscalingUpdateConfautoscalingusageplanBB4A49A7 Metadata: aws:cdk:path: autoscaling-update/APIGWAutoscalingUpdateConf/autoscalingusageplan/UsagePlanKeyResource authorizer: Type: AWS::ApiGateway::Authorizer Properties: RestApiId: Ref: APIGWAutoscalingUpdateConf622FBC28 Type: TOKEN AuthorizerUri: Fn::Join: - "" - - arn:aws:apigateway:eu-west-1:lambda:path/2015-03-31/functions/ - Fn::GetAtt: - LambdaApiAuthorizer041A6040 - Arn - /invocations IdentitySource: method.request.header.AUTH IdentityValidationExpression: TESTAUTH Name: test Metadata: aws:cdk:path: autoscaling-update/authorizer CDKMetadata: Type: AWS::CDK::Metadata Properties: Modules: aws-cdk=1.13.1,@aws-cdk/assets=1.13.0,@aws-cdk/aws-apigateway=1.13.0,@aws-cdk/aws-certificatemanager=1.13.0,@aws-cdk/aws-cloudformation=1.13.0,@aws-cdk/aws-cloudwatch=1.13.0,@aws-cdk/aws-ec2=1.13.0,@aws-cdk/aws-elasticloadbalancingv2=1.13.0,@aws-cdk/aws-events=1.13.0,@aws-cdk/aws-iam=1.13.0,@aws-cdk/aws-kms=1.13.0,@aws-cdk/aws-lambda=1.13.0,@aws-cdk/aws-logs=1.13.0,@aws-cdk/aws-route53=1.13.0,@aws-cdk/aws-s3=1.13.0,@aws-cdk/aws-s3-assets=1.13.0,@aws-cdk/aws-sns=1.13.0,@aws-cdk/aws-sqs=1.13.0,@aws-cdk/aws-ssm=1.13.0,@aws-cdk/core=1.13.0,@aws-cdk/cx-api=1.13.0,@aws-cdk/region-info=1.13.0,jsii-runtime=Python/3.7.1 Parameters: AssetParameters542322311cf5b080f91ac2277149612efec51045c1aa6d8ff501a32aae709c7dS3BUCKETINFO Type: String Description: S3BUCKETINFO AssetParameters542322311cf5b080f91ac2277149612efec51045c1aa6d8ff501a32aae709c7dS3BUCKETINFO Type: String Description: S3BUCKETINFO AssetParameters542322311cf5b080f91ac2277149612efec51045c1aa6d8ff501a32aae709c7dArtifactHashEAC21EFC: Type: String Description: Artifact hash for asset "542322311cf5b080f91ac2277149612efec51045c1aa6d8ff501a32aae709c7d" Outputs: APIGWAutoscalingUpdateConfEndpoint736DE7AC: Value: Fn::Join: - "" - - https:// - Ref: APIGWAutoscalingUpdateConf622FBC28 - .execute-api.eu-west-1. - Ref: AWS::URLSuffix - / - Ref: APIGWAutoscalingUpdateConfDeploymentStageprod21EA514A - /