Resources: booksapiE1885304: Type: AWS::ApiGateway::RestApi Properties: Name: books-api Metadata: aws:cdk:path: ApiCorsIssueStack/books-api/Resource booksapiCloudWatchRole089CB225: 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: ApiCorsIssueStack/books-api/CloudWatchRole/Resource booksapiAccountDBA98FB9: Type: AWS::ApiGateway::Account Properties: CloudWatchRoleArn: Fn::GetAtt: - booksapiCloudWatchRole089CB225 - Arn DependsOn: - booksapiE1885304 Metadata: aws:cdk:path: ApiCorsIssueStack/books-api/Account booksapiDeployment308B08F1f777c04f9239f46d484e03a2a169e310: Type: AWS::ApiGateway::Deployment Properties: RestApiId: Ref: booksapiE1885304 Description: Automatically created by the RestApi construct DependsOn: - booksapiANYF4F0CDEB Metadata: aws:cdk:path: ApiCorsIssueStack/books-api/Deployment/Resource booksapiDeploymentStageprod55D8E03E: Type: AWS::ApiGateway::Stage Properties: RestApiId: Ref: booksapiE1885304 DeploymentId: Ref: booksapiDeployment308B08F1f777c04f9239f46d484e03a2a169e310 StageName: prod Metadata: aws:cdk:path: ApiCorsIssueStack/books-api/DeploymentStage.prod/Resource booksapiANYF4F0CDEB: Type: AWS::ApiGateway::Method Properties: HttpMethod: ANY ResourceId: Fn::GetAtt: - booksapiE1885304 - RootResourceId RestApiId: Ref: booksapiE1885304 AuthorizationType: NONE Integration: Type: MOCK Metadata: aws:cdk:path: ApiCorsIssueStack/books-api/Default/ANY/Resource ApiF70053CD: Type: AWS::ApiGateway::RestApi Properties: Name: Api Metadata: aws:cdk:path: ApiCorsIssueStack/Api/Resource ApiCloudWatchRole73EC6FC4: 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: ApiCorsIssueStack/Api/CloudWatchRole/Resource ApiAccountA18C9B29: Type: AWS::ApiGateway::Account Properties: CloudWatchRoleArn: Fn::GetAtt: - ApiCloudWatchRole73EC6FC4 - Arn DependsOn: - ApiF70053CD Metadata: aws:cdk:path: ApiCorsIssueStack/Api/Account ApiDeploymentB17BE62Db88257c77a8ea9c3c9d7e89caa481b78: Type: AWS::ApiGateway::Deployment Properties: RestApiId: Ref: ApiF70053CD Description: Automatically created by the RestApi construct DependsOn: - ApiGET9257B917 - ApiOPTIONS5886EA5D Metadata: aws:cdk:path: ApiCorsIssueStack/Api/Deployment/Resource ApiDeploymentStageprod3EB9684E: Type: AWS::ApiGateway::Stage Properties: RestApiId: Ref: ApiF70053CD DeploymentId: Ref: ApiDeploymentB17BE62Db88257c77a8ea9c3c9d7e89caa481b78 StageName: prod Metadata: aws:cdk:path: ApiCorsIssueStack/Api/DeploymentStage.prod/Resource ApiOPTIONS5886EA5D: Type: AWS::ApiGateway::Method Properties: HttpMethod: OPTIONS ResourceId: Fn::GetAtt: - ApiF70053CD - RootResourceId RestApiId: Ref: ApiF70053CD AuthorizationType: NONE Integration: IntegrationResponses: - ResponseParameters: method.response.header.Access-Control-Allow-Headers: "'Content-Type,X-Amz-Date,Authorization'" method.response.header.Access-Control-Allow-Origin: "'*'" method.response.header.Access-Control-Allow-Methods: "'GET'" method.response.header.Access-Control-Allow-Credentials: "'true'" method.response.header.Access-Control-Max-Age: "'510'" StatusCode: "204" RequestTemplates: application/json: "{ statusCode: 200 }" Type: MOCK MethodResponses: - ResponseParameters: method.response.header.Access-Control-Allow-Headers: true method.response.header.Access-Control-Allow-Origin: true method.response.header.Access-Control-Allow-Methods: true StatusCode: "204" Metadata: aws:cdk:path: ApiCorsIssueStack/Api/Default/OPTIONS/Resource ApiGETApiPermissionApiCorsIssueStackApi950B6C1BGET1C047A2F: Type: AWS::Lambda::Permission Properties: Action: lambda:InvokeFunction FunctionName: Fn::GetAtt: - LambdaD247545B - Arn Principal: apigateway.amazonaws.com SourceArn: Fn::Join: - "" - - "arn:" - Ref: AWS::Partition - ":execute-api:" - Ref: AWS::Region - ":" - Ref: AWS::AccountId - ":" - Ref: ApiF70053CD - / - Ref: ApiDeploymentStageprod3EB9684E - /GET/ Metadata: aws:cdk:path: ApiCorsIssueStack/Api/Default/GET/ApiPermission.ApiCorsIssueStackApi950B6C1B.GET.. ApiGETApiPermissionTestApiCorsIssueStackApi950B6C1BGET84B968FF: Type: AWS::Lambda::Permission Properties: Action: lambda:InvokeFunction FunctionName: Fn::GetAtt: - LambdaD247545B - Arn Principal: apigateway.amazonaws.com SourceArn: Fn::Join: - "" - - "arn:" - Ref: AWS::Partition - ":execute-api:" - Ref: AWS::Region - ":" - Ref: AWS::AccountId - ":" - Ref: ApiF70053CD - /test-invoke-stage/GET/ Metadata: aws:cdk:path: ApiCorsIssueStack/Api/Default/GET/ApiPermission.Test.ApiCorsIssueStackApi950B6C1B.GET.. ApiGET9257B917: Type: AWS::ApiGateway::Method Properties: HttpMethod: GET ResourceId: Fn::GetAtt: - ApiF70053CD - RootResourceId RestApiId: Ref: ApiF70053CD 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: - LambdaD247545B - Arn - /invocations Metadata: aws:cdk:path: ApiCorsIssueStack/Api/Default/GET/Resource LambdaServiceRoleA8ED4D3B: 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: ApiCorsIssueStack/Lambda/ServiceRole/Resource LambdaD247545B: Type: AWS::Lambda::Function Properties: Code: S3Bucket: Ref: AssetParametersd993ee10bdd2d5f2054086eb58ff286f13672de94811036fc40c647e0e1b17c7S3BucketEA8808C3 S3Key: Fn::Join: - "" - - Fn::Select: - 0 - Fn::Split: - "||" - Ref: AssetParametersd993ee10bdd2d5f2054086eb58ff286f13672de94811036fc40c647e0e1b17c7S3VersionKeyF3B3F55C - Fn::Select: - 1 - Fn::Split: - "||" - Ref: AssetParametersd993ee10bdd2d5f2054086eb58ff286f13672de94811036fc40c647e0e1b17c7S3VersionKeyF3B3F55C Role: Fn::GetAtt: - LambdaServiceRoleA8ED4D3B - Arn Handler: main.handler Runtime: python3.8 DependsOn: - LambdaServiceRoleA8ED4D3B Metadata: aws:cdk:path: ApiCorsIssueStack/Lambda/Resource aws:asset:path: ../ aws:asset:property: Code CDKMetadata: Type: AWS::CDK::Metadata Properties: Analytics: v2:deflate64:H4sIAAAAAAAA/01Q0U7DMAz8Ft7TbAUJ8Ui3iTcEGl9gElOyNkkVO0xTlX8nbqnEk8/O2XeXVrf3T3p/9wxXaowddrOJCfX8wWAGdfwKb5mnzKojQq7D3oVeHWMgTtmwEN4hgUfGJM0ZKeZkUHBlWccuhqLk+AyT64HxCjc9Vx53k/tb2WBnTMyB1QmnMd48hkXgXycGltsr2NQOQKhekb+jlccVFeXAV6U4LhtSixrBf1rQs/jG5B1R9adecjBiVHgbLooeGpDUpJfwtdeHbAZkkStFhWhRX2j30z7qdl//8ELONakGcB71ea2/YXb5MGABAAA= Metadata: aws:cdk:path: ApiCorsIssueStack/CDKMetadata/Default Condition: CDKMetadataAvailable Outputs: booksapiEndpointE230E8D5: Value: Fn::Join: - "" - - https:// - Ref: booksapiE1885304 - .execute-api. - Ref: AWS::Region - "." - Ref: AWS::URLSuffix - / - Ref: booksapiDeploymentStageprod55D8E03E - / ApiEndpoint4F160690: Value: Fn::Join: - "" - - https:// - Ref: ApiF70053CD - .execute-api. - Ref: AWS::Region - "." - Ref: AWS::URLSuffix - / - Ref: ApiDeploymentStageprod3EB9684E - / Parameters: AssetParametersd993ee10bdd2d5f2054086eb58ff286f13672de94811036fc40c647e0e1b17c7S3BucketEA8808C3: Type: String Description: S3 bucket for asset "d993ee10bdd2d5f2054086eb58ff286f13672de94811036fc40c647e0e1b17c7" AssetParametersd993ee10bdd2d5f2054086eb58ff286f13672de94811036fc40c647e0e1b17c7S3VersionKeyF3B3F55C: Type: String Description: S3 key for asset version "d993ee10bdd2d5f2054086eb58ff286f13672de94811036fc40c647e0e1b17c7" AssetParametersd993ee10bdd2d5f2054086eb58ff286f13672de94811036fc40c647e0e1b17c7ArtifactHash35D8C0EC: Type: String Description: Artifact hash for asset "d993ee10bdd2d5f2054086eb58ff286f13672de94811036fc40c647e0e1b17c7" Conditions: CDKMetadataAvailable: Fn::Or: - Fn::Or: - Fn::Equals: - Ref: AWS::Region - af-south-1 - 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::Or: - Fn::Equals: - Ref: AWS::Region - eu-central-1 - Fn::Equals: - Ref: AWS::Region - eu-north-1 - Fn::Equals: - Ref: AWS::Region - eu-south-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::Or: - Fn::Equals: - Ref: AWS::Region - us-west-1 - Fn::Equals: - Ref: AWS::Region - us-west-2