Created
October 14, 2019 19:49
-
-
Save MatteoJoliveau/cfd2046e4d1077847bbfcc68d84b93cd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Resources: | |
| HelloFunctionServiceRole186F1BA8: | |
| 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: HelloStack/HelloFunction/ServiceRole/Resource | |
| HelloFunctionD909AE8C: | |
| Type: AWS::Lambda::Function | |
| Properties: | |
| Code: | |
| S3Bucket: | |
| Ref: AssetParameters2a90e50b032c20380ece2e2a3e1ebfd864ad3fa05b7d7fe844e3bdd82f6b2abeS3BucketFC26DB32 | |
| S3Key: | |
| Fn::Join: | |
| - "" | |
| - - Fn::Select: | |
| - 0 | |
| - Fn::Split: | |
| - "||" | |
| - Ref: AssetParameters2a90e50b032c20380ece2e2a3e1ebfd864ad3fa05b7d7fe844e3bdd82f6b2abeS3VersionKey7F0DB781 | |
| - Fn::Select: | |
| - 1 | |
| - Fn::Split: | |
| - "||" | |
| - Ref: AssetParameters2a90e50b032c20380ece2e2a3e1ebfd864ad3fa05b7d7fe844e3bdd82f6b2abeS3VersionKey7F0DB781 | |
| Handler: index.handler | |
| Role: | |
| Fn::GetAtt: | |
| - HelloFunctionServiceRole186F1BA8 | |
| - Arn | |
| Runtime: nodejs10.x | |
| DependsOn: | |
| - HelloFunctionServiceRole186F1BA8 | |
| Metadata: | |
| aws:cdk:path: HelloStack/HelloFunction/Resource | |
| aws:asset:path: asset.2a90e50b032c20380ece2e2a3e1ebfd864ad3fa05b7d7fe844e3bdd82f6b2abe | |
| aws:asset:property: Code | |
| HelloStackHelloFunction7E40E13BApiEventSourceA7A86A4F7F53DCEC: | |
| Type: AWS::ApiGateway::RestApi | |
| Properties: | |
| Name: HelloStackHelloFunction7E40E13B:ApiEventSourceA7A86A4F | |
| Metadata: | |
| aws:cdk:path: HelloStack/HelloStackHelloFunction7E40E13B:ApiEventSourceA7A86A4F/Resource | |
| HelloStackHelloFunction7E40E13BApiEventSourceA7A86A4FDeployment956C7DE168ab956beb270ee98490ef1001d036ba: | |
| Type: AWS::ApiGateway::Deployment | |
| Properties: | |
| RestApiId: | |
| Ref: HelloStackHelloFunction7E40E13BApiEventSourceA7A86A4F7F53DCEC | |
| Description: Automatically created by the RestApi construct | |
| DependsOn: | |
| - HelloStackHelloFunction7E40E13BApiEventSourceA7A86A4FhelloGET91C1F24A | |
| - HelloStackHelloFunction7E40E13BApiEventSourceA7A86A4Fhello09D1A141 | |
| Metadata: | |
| aws:cdk:path: HelloStack/HelloStackHelloFunction7E40E13B:ApiEventSourceA7A86A4F/Deployment/Resource | |
| HelloStackHelloFunction7E40E13BApiEventSourceA7A86A4FDeploymentStageprod14798157: | |
| Type: AWS::ApiGateway::Stage | |
| Properties: | |
| RestApiId: | |
| Ref: HelloStackHelloFunction7E40E13BApiEventSourceA7A86A4F7F53DCEC | |
| DeploymentId: | |
| Ref: HelloStackHelloFunction7E40E13BApiEventSourceA7A86A4FDeployment956C7DE168ab956beb270ee98490ef1001d036ba | |
| StageName: prod | |
| Metadata: | |
| aws:cdk:path: HelloStack/HelloStackHelloFunction7E40E13B:ApiEventSourceA7A86A4F/DeploymentStage.prod/Resource | |
| HelloStackHelloFunction7E40E13BApiEventSourceA7A86A4FCloudWatchRoleD2C81C0E: | |
| 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: HelloStack/HelloStackHelloFunction7E40E13B:ApiEventSourceA7A86A4F/CloudWatchRole/Resource | |
| HelloStackHelloFunction7E40E13BApiEventSourceA7A86A4FAccountD400AA43: | |
| Type: AWS::ApiGateway::Account | |
| Properties: | |
| CloudWatchRoleArn: | |
| Fn::GetAtt: | |
| - HelloStackHelloFunction7E40E13BApiEventSourceA7A86A4FCloudWatchRoleD2C81C0E | |
| - Arn | |
| DependsOn: | |
| - HelloStackHelloFunction7E40E13BApiEventSourceA7A86A4F7F53DCEC | |
| Metadata: | |
| aws:cdk:path: HelloStack/HelloStackHelloFunction7E40E13B:ApiEventSourceA7A86A4F/Account | |
| HelloStackHelloFunction7E40E13BApiEventSourceA7A86A4Fhello09D1A141: | |
| Type: AWS::ApiGateway::Resource | |
| Properties: | |
| ParentId: | |
| Fn::GetAtt: | |
| - HelloStackHelloFunction7E40E13BApiEventSourceA7A86A4F7F53DCEC | |
| - RootResourceId | |
| PathPart: hello | |
| RestApiId: | |
| Ref: HelloStackHelloFunction7E40E13BApiEventSourceA7A86A4F7F53DCEC | |
| Metadata: | |
| aws:cdk:path: HelloStack/HelloStackHelloFunction7E40E13B:ApiEventSourceA7A86A4F/Default/hello/Resource | |
| HelloStackHelloFunction7E40E13BApiEventSourceA7A86A4FhelloGETApiPermissionHelloStackHelloStackHelloFunction7E40E13BApiEventSourceA7A86A4F3C847C00GEThelloB4061258: | |
| Type: AWS::Lambda::Permission | |
| Properties: | |
| Action: lambda:InvokeFunction | |
| FunctionName: | |
| Fn::GetAtt: | |
| - HelloFunctionD909AE8C | |
| - Arn | |
| Principal: apigateway.amazonaws.com | |
| SourceArn: | |
| Fn::Join: | |
| - "" | |
| - - "arn:" | |
| - Ref: AWS::Partition | |
| - ":execute-api:" | |
| - Ref: AWS::Region | |
| - ":" | |
| - Ref: AWS::AccountId | |
| - ":" | |
| - Ref: HelloStackHelloFunction7E40E13BApiEventSourceA7A86A4F7F53DCEC | |
| - / | |
| - Ref: HelloStackHelloFunction7E40E13BApiEventSourceA7A86A4FDeploymentStageprod14798157 | |
| - /GET/hello | |
| Metadata: | |
| aws:cdk:path: HelloStack/HelloStackHelloFunction7E40E13B:ApiEventSourceA7A86A4F/Default/hello/GET/ApiPermission.HelloStackHelloStackHelloFunction7E40E13BApiEventSourceA7A86A4F3C847C00.GET..hello | |
| HelloStackHelloFunction7E40E13BApiEventSourceA7A86A4FhelloGETApiPermissionTestHelloStackHelloStackHelloFunction7E40E13BApiEventSourceA7A86A4F3C847C00GEThello70EFAAB3: | |
| Type: AWS::Lambda::Permission | |
| Properties: | |
| Action: lambda:InvokeFunction | |
| FunctionName: | |
| Fn::GetAtt: | |
| - HelloFunctionD909AE8C | |
| - Arn | |
| Principal: apigateway.amazonaws.com | |
| SourceArn: | |
| Fn::Join: | |
| - "" | |
| - - "arn:" | |
| - Ref: AWS::Partition | |
| - ":execute-api:" | |
| - Ref: AWS::Region | |
| - ":" | |
| - Ref: AWS::AccountId | |
| - ":" | |
| - Ref: HelloStackHelloFunction7E40E13BApiEventSourceA7A86A4F7F53DCEC | |
| - /test-invoke-stage/GET/hello | |
| Metadata: | |
| aws:cdk:path: HelloStack/HelloStackHelloFunction7E40E13B:ApiEventSourceA7A86A4F/Default/hello/GET/ApiPermission.Test.HelloStackHelloStackHelloFunction7E40E13BApiEventSourceA7A86A4F3C847C00.GET..hello | |
| HelloStackHelloFunction7E40E13BApiEventSourceA7A86A4FhelloGET91C1F24A: | |
| Type: AWS::ApiGateway::Method | |
| Properties: | |
| HttpMethod: GET | |
| ResourceId: | |
| Ref: HelloStackHelloFunction7E40E13BApiEventSourceA7A86A4Fhello09D1A141 | |
| RestApiId: | |
| Ref: HelloStackHelloFunction7E40E13BApiEventSourceA7A86A4F7F53DCEC | |
| AuthorizationType: NONE | |
| Integration: | |
| IntegrationHttpMethod: POST | |
| Type: AWS_PROXY | |
| Uri: | |
| Fn::Join: | |
| - "" | |
| - - "arn:" | |
| - Ref: AWS::Partition | |
| - ":apigateway:" | |
| - Ref: AWS::Region | |
| - :lambda:path/2015-03-31/functions/ | |
| - Fn::GetAtt: | |
| - HelloFunctionD909AE8C | |
| - Arn | |
| - /invocations | |
| Metadata: | |
| aws:cdk:path: HelloStack/HelloStackHelloFunction7E40E13B:ApiEventSourceA7A86A4F/Default/hello/GET/Resource | |
| CDKMetadata: | |
| Type: AWS::CDK::Metadata | |
| Properties: | |
| Modules: aws-cdk=1.12.0,@aws-cdk/assets=1.12.0,@aws-cdk/aws-apigateway=1.12.0,@aws-cdk/aws-applicationautoscaling=1.12.0,@aws-cdk/aws-autoscaling-common=1.12.0,@aws-cdk/aws-cloudwatch=1.12.0,@aws-cdk/aws-dynamodb=1.12.0,@aws-cdk/aws-ec2=1.12.0,@aws-cdk/aws-events=1.12.0,@aws-cdk/aws-iam=1.12.0,@aws-cdk/aws-kms=1.12.0,@aws-cdk/aws-lambda=1.12.0,@aws-cdk/aws-lambda-event-sources=1.12.0,@aws-cdk/aws-s3=1.12.0,@aws-cdk/aws-s3-assets=1.12.0,@aws-cdk/aws-s3-notifications=1.12.0,@aws-cdk/aws-sns=1.12.0,@aws-cdk/aws-sns-subscriptions=1.12.0,@aws-cdk/aws-sqs=1.12.0,@aws-cdk/aws-ssm=1.12.0,@aws-cdk/core=1.12.0,@aws-cdk/cx-api=1.12.0,@aws-cdk/region-info=1.12.0,jsii-runtime=node.js/v12.11.1 | |
| Condition: CDKMetadataAvailable | |
| Parameters: | |
| AssetParameters2a90e50b032c20380ece2e2a3e1ebfd864ad3fa05b7d7fe844e3bdd82f6b2abeS3BucketFC26DB32: | |
| Type: String | |
| Description: S3 bucket for asset "2a90e50b032c20380ece2e2a3e1ebfd864ad3fa05b7d7fe844e3bdd82f6b2abe" | |
| AssetParameters2a90e50b032c20380ece2e2a3e1ebfd864ad3fa05b7d7fe844e3bdd82f6b2abeS3VersionKey7F0DB781: | |
| Type: String | |
| Description: S3 key for asset version "2a90e50b032c20380ece2e2a3e1ebfd864ad3fa05b7d7fe844e3bdd82f6b2abe" | |
| AssetParameters2a90e50b032c20380ece2e2a3e1ebfd864ad3fa05b7d7fe844e3bdd82f6b2abeArtifactHash25B780EE: | |
| Type: String | |
| Description: Artifact hash for asset "2a90e50b032c20380ece2e2a3e1ebfd864ad3fa05b7d7fe844e3bdd82f6b2abe" | |
| Outputs: | |
| HelloStackHelloFunction7E40E13BApiEventSourceA7A86A4FEndpoint0ACF7208: | |
| Value: | |
| Fn::Join: | |
| - "" | |
| - - https:// | |
| - Ref: HelloStackHelloFunction7E40E13BApiEventSourceA7A86A4F7F53DCEC | |
| - .execute-api. | |
| - Ref: AWS::Region | |
| - "." | |
| - Ref: AWS::URLSuffix | |
| - / | |
| - Ref: HelloStackHelloFunction7E40E13BApiEventSourceA7A86A4FDeploymentStageprod14798157 | |
| - / | |
| Conditions: | |
| CDKMetadataAvailable: | |
| Fn::Or: | |
| - Fn::Or: | |
| - Fn::Equals: | |
| - Ref: AWS::Region | |
| - ap-east-1 | |
| - Fn::Equals: | |
| - Ref: AWS::Region | |
| - ap-northeast-1 | |
| - Fn::Equals: | |
| - Ref: AWS::Region | |
| - ap-northeast-2 | |
| - Fn::Equals: | |
| - Ref: AWS::Region | |
| - ap-south-1 | |
| - Fn::Equals: | |
| - Ref: AWS::Region | |
| - ap-southeast-1 | |
| - Fn::Equals: | |
| - Ref: AWS::Region | |
| - ap-southeast-2 | |
| - Fn::Equals: | |
| - Ref: AWS::Region | |
| - ca-central-1 | |
| - Fn::Equals: | |
| - Ref: AWS::Region | |
| - cn-north-1 | |
| - Fn::Equals: | |
| - Ref: AWS::Region | |
| - cn-northwest-1 | |
| - Fn::Equals: | |
| - Ref: AWS::Region | |
| - eu-central-1 | |
| - Fn::Or: | |
| - Fn::Equals: | |
| - Ref: AWS::Region | |
| - eu-north-1 | |
| - Fn::Equals: | |
| - Ref: AWS::Region | |
| - eu-west-1 | |
| - Fn::Equals: | |
| - Ref: AWS::Region | |
| - eu-west-2 | |
| - Fn::Equals: | |
| - Ref: AWS::Region | |
| - eu-west-3 | |
| - Fn::Equals: | |
| - Ref: AWS::Region | |
| - me-south-1 | |
| - Fn::Equals: | |
| - Ref: AWS::Region | |
| - sa-east-1 | |
| - Fn::Equals: | |
| - Ref: AWS::Region | |
| - us-east-1 | |
| - Fn::Equals: | |
| - Ref: AWS::Region | |
| - us-east-2 | |
| - Fn::Equals: | |
| - Ref: AWS::Region | |
| - us-west-1 | |
| - Fn::Equals: | |
| - Ref: AWS::Region | |
| - us-west-2 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import cdk = require('@aws-cdk/core'); | |
| import lambda = require('@aws-cdk/aws-lambda') | |
| import eventSources = require('@aws-cdk/aws-lambda-event-sources') | |
| export class HelloStack extends cdk.Stack { | |
| constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) { | |
| super(scope, id, props); | |
| const fn = new lambda.Function(this, 'HelloFunction', { | |
| runtime: lambda.Runtime.NODEJS_10_X, | |
| code: lambda.Code.asset('lambda'), | |
| handler: 'index.handler' | |
| }) | |
| fn.addEventSource(new eventSources.ApiEventSource('GET', '/hello')) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment