diff --git a/src/modules/apigw/index.ts b/src/modules/apigw/index.ts index cff92c1..4885223 100644 --- a/src/modules/apigw/index.ts +++ b/src/modules/apigw/index.ts @@ -151,6 +151,23 @@ export default class Apigw { outputs.usagePlan = usagePlan; } + try { + const { tags } = inputs; + if (tags) { + await this.tagClient.deployResourceTags({ + tags: tags.map(({ key, value }) => ({ TagKey: key, TagValue: value })), + resourceId: serviceId, + serviceType: ApiServiceType.apigw, + resourcePrefix: 'service', + }); + if (tags.length > 0) { + outputs.tags = tags; + } + } + } catch (e) { + console.log(`[TAG] ${e.message}`); + } + // return this.formatApigwOutputs(outputs); return outputs; }