Skip to content

Instantly share code, notes, and snippets.

@flexelem
Last active March 18, 2021 17:27
Show Gist options
  • Save flexelem/fb328e3691bca00fff30dabc2d5294f8 to your computer and use it in GitHub Desktop.
Save flexelem/fb328e3691bca00fff30dabc2d5294f8 to your computer and use it in GitHub Desktop.
Resources:
costapi8876B5F2:
Type: AWS::ApiGateway::RestApi
Properties:
EndpointConfiguration:
Types:
- EDGE
Name: cost-api
Metadata:
aws:cdk:path: CostApiAlfa/cost-api/Resource
costapiCloudWatchRole2DEFB289:
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: CostApiAlfa/cost-api/CloudWatchRole/Resource
costapiAccount42F0C504:
Type: AWS::ApiGateway::Account
Properties:
CloudWatchRoleArn:
Fn::GetAtt:
- costapiCloudWatchRole2DEFB289
- Arn
DependsOn:
- costapi8876B5F2
Metadata:
aws:cdk:path: CostApiAlfa/cost-api/Account
costapiDeploymentEF9D38C264a6f325ad32253d6a6fd20cac8a4d11:
Type: AWS::ApiGateway::Deployment
Properties:
RestApiId:
Ref: costapi8876B5F2
Description: Automatically created by the RestApi construct
DependsOn:
- costapiv1OPTIONSD0D5B553
- costapiv1POST508F6E61
- costapiv18E2055B2
Metadata:
aws:cdk:path: CostApiAlfa/cost-api/Deployment/Resource
costapiDeploymentStagelive644057A0:
Type: AWS::ApiGateway::Stage
Properties:
RestApiId:
Ref: costapi8876B5F2
DeploymentId:
Ref: costapiDeploymentEF9D38C264a6f325ad32253d6a6fd20cac8a4d11
MethodSettings:
- DataTraceEnabled: true
HttpMethod: "*"
LoggingLevel: INFO
ResourcePath: /*
StageName: live
TracingEnabled: true
Metadata:
aws:cdk:path: CostApiAlfa/cost-api/DeploymentStage.live/Resource
costapiv18E2055B2:
Type: AWS::ApiGateway::Resource
Properties:
ParentId:
Fn::GetAtt:
- costapi8876B5F2
- RootResourceId
PathPart: v1
RestApiId:
Ref: costapi8876B5F2
Metadata:
aws:cdk:path: CostApiAlfa/cost-api/Default/v1/Resource
costapiv1POSTApiPermissionCostApiAlfacostapi142800DBPOSTv1F841A793:
Type: AWS::Lambda::Permission
Properties:
Action: lambda:InvokeFunction
FunctionName:
Fn::GetAtt:
- costPostV1Function0C3CA513
- Arn
Principal: apigateway.amazonaws.com
SourceArn:
Fn::Join:
- ""
- - "arn:"
- Ref: AWS::Partition
- ":execute-api:eu-central-1:214839824702:"
- Ref: costapi8876B5F2
- /
- Ref: costapiDeploymentStagelive644057A0
- /POST/v1
Metadata:
aws:cdk:path: CostApiAlfa/cost-api/Default/v1/POST/ApiPermission.CostApiAlfacostapi142800DB.POST..v1
costapiv1POSTApiPermissionTestCostApiAlfacostapi142800DBPOSTv191B8313D:
Type: AWS::Lambda::Permission
Properties:
Action: lambda:InvokeFunction
FunctionName:
Fn::GetAtt:
- costPostV1Function0C3CA513
- Arn
Principal: apigateway.amazonaws.com
SourceArn:
Fn::Join:
- ""
- - "arn:"
- Ref: AWS::Partition
- ":execute-api:eu-central-1:214839824702:"
- Ref: costapi8876B5F2
- /test-invoke-stage/POST/v1
Metadata:
aws:cdk:path: CostApiAlfa/cost-api/Default/v1/POST/ApiPermission.Test.CostApiAlfacostapi142800DB.POST..v1
costapiv1POST508F6E61:
Type: AWS::ApiGateway::Method
Properties:
HttpMethod: POST
ResourceId:
Ref: costapiv18E2055B2
RestApiId:
Ref: costapi8876B5F2
AuthorizationType: NONE
Integration:
IntegrationHttpMethod: POST
Type: AWS_PROXY
Uri:
Fn::Join:
- ""
- - "arn:"
- Ref: AWS::Partition
- :apigateway:eu-central-1:lambda:path/2015-03-31/functions/
- Fn::GetAtt:
- costPostV1Function0C3CA513
- Arn
- /invocations
Metadata:
aws:cdk:path: CostApiAlfa/cost-api/Default/v1/POST/Resource
costapiv1OPTIONSD0D5B553:
Type: AWS::ApiGateway::Method
Properties:
HttpMethod: OPTIONS
ResourceId:
Ref: costapiv18E2055B2
RestApiId:
Ref: costapi8876B5F2
AuthorizationType: NONE
Integration:
IntegrationResponses:
- ResponseParameters:
method.response.header.Access-Control-Allow-Headers: "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token,X-Requested-With,X-Shipper-Version'"
method.response.header.Access-Control-Allow-Origin: "'*'"
method.response.header.Access-Control-Allow-Methods: "'GET,POST,DELETE,PUT,OPTIONS'"
StatusCode: "200"
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: "200"
Metadata:
aws:cdk:path: CostApiAlfa/cost-api/Default/v1/OPTIONS/Resource
costBasePathMapping45C1FF88:
Type: AWS::ApiGateway::BasePathMapping
Properties:
DomainName: alfa.api.yolda.io
BasePath: costs
RestApiId:
Ref: costapi8876B5F2
Stage:
Ref: costapiDeploymentStagelive644057A0
Metadata:
aws:cdk:path: CostApiAlfa/costBasePathMapping/Resource
costLambdaRole76CD4EFE:
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
- Fn::Join:
- ""
- - "arn:"
- Ref: AWS::Partition
- :iam::aws:policy/AmazonSNSFullAccess
- Fn::Join:
- ""
- - "arn:"
- Ref: AWS::Partition
- :iam::aws:policy/AmazonS3FullAccess
- Fn::Join:
- ""
- - "arn:"
- Ref: AWS::Partition
- :iam::aws:policy/AWSXRayDaemonWriteAccess
Metadata:
aws:cdk:path: CostApiAlfa/costLambdaRole/Resource
costPostV1Function0C3CA513:
Type: AWS::Lambda::Function
Properties:
Code:
S3Bucket:
Ref: AssetParametersdc4dcad878f4dc65225f42039944be9c0e8232e692d4a65e4ee5f0e9d4f59935S3Bucket98656818
S3Key:
Fn::Join:
- ""
- - Fn::Select:
- 0
- Fn::Split:
- "||"
- Ref: AssetParametersdc4dcad878f4dc65225f42039944be9c0e8232e692d4a65e4ee5f0e9d4f59935S3VersionKeyD6D679EF
- Fn::Select:
- 1
- Fn::Split:
- "||"
- Ref: AssetParametersdc4dcad878f4dc65225f42039944be9c0e8232e692d4a65e4ee5f0e9d4f59935S3VersionKeyD6D679EF
Role:
Fn::GetAtt:
- costLambdaRole76CD4EFE
- Arn
Handler: lambda/create-cost-lambda.handler
MemorySize: 512
Runtime: nodejs12.x
DependsOn:
- costLambdaRole76CD4EFE
Metadata:
aws:cdk:path: CostApiAlfa/costPostV1Function/Resource
aws:asset:path: /Users/baktas/workspace/cost-api/src
aws:asset:property: Code
CDKMetadata:
Type: AWS::CDK::Metadata
Properties:
Analytics: v2:deflate64:H4sIAAAAAAAAE11Qy07DQAz8lt6dLRFw4EYo4lZRlS8wGzfdNvvQ2ktVRfl3dpNGVJw8Ho9mbNfq5UnVq1e8cKXb83rQPpIavgT1GTYH95kkJIE9sU9REzTMJHnaGdfBxjuWmLQU5Q4jWhKKpVn0IxTjAYPpUOiCVzXkkTTB3FQLbLT2yQm8U+j91ZKbPO+6kkmFm8ES8Ib819wnw5bk6NtC3VCR7lCOWwxh2v7g/lEjGLR5Q9/PVrmO0KP9blEN5USK1jAb7+AjOS0FZHrBI/BjheVBrKY/jSM435I68fqnflZ1rR5WJzamivlUY0nt5/oLPd17OoUBAAA=
Metadata:
aws:cdk:path: CostApiAlfa/CDKMetadata/Default
Outputs:
costapiEndpointFA846E05:
Value:
Fn::Join:
- ""
- - https://
- Ref: costapi8876B5F2
- .execute-api.eu-central-1.
- Ref: AWS::URLSuffix
- /
- Ref: costapiDeploymentStagelive644057A0
- /
Parameters:
AssetParametersdc4dcad878f4dc65225f42039944be9c0e8232e692d4a65e4ee5f0e9d4f59935S3Bucket98656818:
Type: String
Description: S3 bucket for asset "dc4dcad878f4dc65225f42039944be9c0e8232e692d4a65e4ee5f0e9d4f59935"
AssetParametersdc4dcad878f4dc65225f42039944be9c0e8232e692d4a65e4ee5f0e9d4f59935S3VersionKeyD6D679EF:
Type: String
Description: S3 key for asset version "dc4dcad878f4dc65225f42039944be9c0e8232e692d4a65e4ee5f0e9d4f59935"
AssetParametersdc4dcad878f4dc65225f42039944be9c0e8232e692d4a65e4ee5f0e9d4f59935ArtifactHashF5409038:
Type: String
Description: Artifact hash for asset "dc4dcad878f4dc65225f42039944be9c0e8232e692d4a65e4ee5f0e9d4f59935"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment