File tree Expand file tree Collapse file tree 3 files changed +32
-6
lines changed
package/compile/events/api-gateway/lib Expand file tree Collapse file tree 3 files changed +32
-6
lines changed Original file line number Diff line number Diff line change @@ -47,15 +47,31 @@ module.exports = {
4747 const DisableExecuteApiEndpoint =
4848 apiGateway . disableDefaultEndpoint == null ? undefined : apiGateway . disableDefaultEndpoint ;
4949
50+ const properties = {
51+ Name : this . provider . naming . getApiGatewayName ( ) ,
52+ BinaryMediaTypes,
53+ DisableExecuteApiEndpoint,
54+ EndpointConfiguration,
55+ } ;
56+
57+ // Tags
58+ if (
59+ this . serverless . service . provider . tags &&
60+ this . serverless . service . provider . restApi &&
61+ this . serverless . service . provider . restApi . useProviderTags
62+ ) {
63+ properties . Tags = Object . entries ( this . serverless . service . provider . tags ) . map (
64+ ( [ Key , Value ] ) => ( {
65+ Key,
66+ Value,
67+ } )
68+ ) ;
69+ }
70+
5071 _ . merge ( this . serverless . service . provider . compiledCloudFormationTemplate . Resources , {
5172 [ this . apiGatewayRestApiLogicalId ] : {
5273 Type : 'AWS::ApiGateway::RestApi' ,
53- Properties : {
54- Name : this . provider . naming . getApiGatewayName ( ) ,
55- BinaryMediaTypes,
56- DisableExecuteApiEndpoint,
57- EndpointConfiguration,
58- } ,
74+ Properties : properties ,
5975 } ,
6076 } ) ;
6177
Original file line number Diff line number Diff line change @@ -1289,6 +1289,13 @@ class AwsProvider {
12891289 'sa-east-1' ,
12901290 ] ,
12911291 } ,
1292+ restApi : {
1293+ type : 'object' ,
1294+ properties : {
1295+ useProviderTags : { type : 'boolean' } ,
1296+ } ,
1297+ additionalProperties : false ,
1298+ } ,
12921299 role : { $ref : '#/definitions/awsLambdaRole' } ,
12931300 rolePermissionsBoundary : { $ref : '#/definitions/awsArnString' } ,
12941301 rollbackConfiguration : {
Original file line number Diff line number Diff line change @@ -1058,6 +1058,9 @@ export interface AWS {
10581058 | "me-central-1"
10591059 | "me-south-1"
10601060 | "sa-east-1" ;
1061+ restApi ?: {
1062+ useProviderTags ?: boolean ;
1063+ } ;
10611064 role ?: AwsLambdaRole ;
10621065 rolePermissionsBoundary ?: AwsArnString ;
10631066 rollbackConfiguration ?: {
You can’t perform that action at this time.
0 commit comments