Skip to content

Commit

Permalink
Add WebHooks API Gateway
Browse files Browse the repository at this point in the history
  • Loading branch information
ingalls committed Dec 3, 2024
1 parent a77b267 commit f8db57a
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .deploy
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
],
"artifacts": {
"s3": [
"{{stackName}}-{{accountId}}-{{region}}-public/{{gitsha}}/index.html"
"{{rootStackName}}-{{accountId}}-{{region}}-public/{{gitsha}}/index.html"
],
"docker": [
"coe-ecr-etl:{{gitsha}}",
Expand Down
2 changes: 1 addition & 1 deletion cloudformation/lib/pmtiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export default {
PMTilesLambdaAPI: {
Type: 'AWS::ApiGateway::RestApi',
Properties: {
Name: 'PMtiles Rest API',
Name: cf.stackName,
DisableExecuteApiEndpoint: true,
EndpointConfiguration: {
Types: ['REGIONAL']
Expand Down
26 changes: 22 additions & 4 deletions cloudformation/webhooks.template.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default cf.merge(
CloudTAKWebhooksApiDomain: {
Type: 'AWS::ApiGateway::DomainName',
Properties: {
DomainName: cf.join(['tiles.', cf.ref('HostedURL')]),
DomainName: cf.ref('HostedURL'),
RegionalCertificateArn: cf.join(['arn:', cf.partition, ':acm:', cf.region, ':', cf.accountId, ':certificate/', cf.ref('SSLCertificateIdentifier')]),
EndpointConfiguration: {
Types: ['REGIONAL']
Expand All @@ -40,10 +40,28 @@ export default cf.merge(
RestApiId: cf.ref('CloudTAKWebhooksLambdaAPI')
}
},
CloudTAKWebhooksLambdaAPIResourceGET: {
Type: 'AWS::ApiGateway::Method',
Properties: {
AuthorizationType: 'NONE',
HttpMethod: 'GET',
Integration: {
IntegrationResponses: [{
StatusCode: '200'
}],
RequestTemplates: {
'application/json': '{ statusCode: 200 }'
},
Type: 'MOCK'
},
ResourceId: cf.ref('CloudTAKWebhooksLambdaAPIResource'),
RestApiId: cf.ref('CloudTAKWebhooksLambdaAPI')
}
},
CloudTAKWebhooksLambdaAPI: {
Type: 'AWS::ApiGateway::RestApi',
Properties: {
Name: 'CloudTAK Webhooks Rest API',
Name: cf.stackName,
DisableExecuteApiEndpoint: true,
EndpointConfiguration: {
Types: ['REGIONAL']
Expand All @@ -60,7 +78,7 @@ export default cf.merge(
},
CloudTAKWebhooksAPIDeployment: {
Type: 'AWS::ApiGateway::Deployment',
DependsOn: ['CloudTAKWebhooksLambdaAPIResourceGET'],
DependsOn: 'CloudTAKWebhooksLambdaAPIResourceGET',
Properties: {
Description: cf.stackName,
RestApiId: cf.ref('CloudTAKWebhooksLambdaAPI')
Expand All @@ -71,7 +89,7 @@ export default cf.merge(
Properties: {
DeploymentId: cf.ref('CloudTAKWebhooksAPIDeployment'),
RestApiId: cf.ref('CloudTAKWebhooksLambdaAPI'),
StageName: 'tiles'
StageName: 'webhooks'
}
}
}
Expand Down

0 comments on commit f8db57a

Please sign in to comment.