Skip to content

Commit ad9e0d7

Browse files
author
awstools
committed
feat(client-lightsail): Add support for tagging of Alarm resource type
1 parent 34e7b07 commit ad9e0d7

7 files changed

Lines changed: 71 additions & 29 deletions

File tree

clients/client-lightsail/src/commands/CreateContactMethodCommand.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ export interface CreateContactMethodCommandOutput extends CreateContactMethodRes
3232
* You can add one email address and one mobile phone number contact method in each Amazon Web Services Region. However, SMS text messaging is not supported in some Amazon Web Services
3333
* Regions, and SMS text messages cannot be sent to some countries/regions. For more information,
3434
* see <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-notifications">Notifications in Amazon Lightsail</a>.</p>
35+
* <p>The <code>create contact method</code> operation supports tag-based access control via request
36+
* tags. For more information, see the <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-controlling-access-using-tags">Lightsail Developer Guide</a>.</p>
3537
* @example
3638
* Use a bare-bones client and the command you need to make an API call.
3739
* ```javascript

clients/client-lightsail/src/commands/GetAlarmsCommand.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ export interface GetAlarmsCommandOutput extends GetAlarmsResult, __MetadataBeare
8383
* // "OK" || "ALARM" || "INSUFFICIENT_DATA",
8484
* // ],
8585
* // notificationEnabled: true || false,
86+
* // tags: [ // TagList
87+
* // { // Tag
88+
* // key: "STRING_VALUE",
89+
* // value: "STRING_VALUE",
90+
* // },
91+
* // ],
8692
* // },
8793
* // ],
8894
* // nextPageToken: "STRING_VALUE",

clients/client-lightsail/src/commands/PutAlarmCommand.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ export interface PutAlarmCommandOutput extends PutAlarmResult, __MetadataBearer
3838
* <p>When you update an existing alarm, its state is left unchanged, but the update completely
3939
* overwrites the previous configuration of the alarm. The alarm is then evaluated with the
4040
* updated configuration.</p>
41+
* <p>The <code>put alarm</code> operation supports tag-based access control via request
42+
* tags. For more information, see the <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-controlling-access-using-tags">Lightsail Developer Guide</a>.</p>
4143
* @example
4244
* Use a bare-bones client and the command you need to make an API call.
4345
* ```javascript
@@ -62,6 +64,12 @@ export interface PutAlarmCommandOutput extends PutAlarmResult, __MetadataBearer
6264
* "OK" || "ALARM" || "INSUFFICIENT_DATA",
6365
* ],
6466
* notificationEnabled: true || false,
67+
* tags: [ // TagList
68+
* { // Tag
69+
* key: "STRING_VALUE",
70+
* value: "STRING_VALUE",
71+
* },
72+
* ],
6573
* };
6674
* const command = new PutAlarmCommand(input);
6775
* const response = await client.send(command);

clients/client-lightsail/src/models/models_0.ts

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,29 @@ export interface MonitoredResourceInfo {
540540
resourceType?: ResourceType | undefined;
541541
}
542542

543+
/**
544+
* <p>Describes a tag key and optional value assigned to an Amazon Lightsail resource.</p>
545+
* <p>For more information about tags in Lightsail, see the <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-tags">Amazon Lightsail Developer Guide</a>.</p>
546+
* @public
547+
*/
548+
export interface Tag {
549+
/**
550+
* <p>The key of the tag.</p>
551+
* <p>Constraints: Tag keys accept a maximum of 128 letters, numbers, spaces in UTF-8, or the
552+
* following characters: + - = . _ : / @</p>
553+
* @public
554+
*/
555+
key?: string | undefined;
556+
557+
/**
558+
* <p>The value of the tag.</p>
559+
* <p>Constraints: Tag values accept a maximum of 256 letters, numbers, spaces in UTF-8, or the
560+
* following characters: + - = . _ : / @</p>
561+
* @public
562+
*/
563+
value?: string | undefined;
564+
}
565+
543566
/**
544567
* <p>Describes an alarm.</p>
545568
* <p>An alarm is a way to monitor your Lightsail resource metrics. For more information, see
@@ -740,6 +763,13 @@ export interface Alarm {
740763
* @public
741764
*/
742765
notificationEnabled?: boolean | undefined;
766+
767+
/**
768+
* <p>The tag keys and optional values for the resource. For more information about tags in
769+
* Lightsail, see the <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-tags">Amazon Lightsail Developer Guide</a>.</p>
770+
* @public
771+
*/
772+
tags?: Tag[] | undefined;
743773
}
744774

745775
/**
@@ -1361,29 +1391,6 @@ export interface BucketState {
13611391
message?: string | undefined;
13621392
}
13631393

1364-
/**
1365-
* <p>Describes a tag key and optional value assigned to an Amazon Lightsail resource.</p>
1366-
* <p>For more information about tags in Lightsail, see the <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-tags">Amazon Lightsail Developer Guide</a>.</p>
1367-
* @public
1368-
*/
1369-
export interface Tag {
1370-
/**
1371-
* <p>The key of the tag.</p>
1372-
* <p>Constraints: Tag keys accept a maximum of 128 letters, numbers, spaces in UTF-8, or the
1373-
* following characters: + - = . _ : / @</p>
1374-
* @public
1375-
*/
1376-
key?: string | undefined;
1377-
1378-
/**
1379-
* <p>The value of the tag.</p>
1380-
* <p>Constraints: Tag values accept a maximum of 256 letters, numbers, spaces in UTF-8, or the
1381-
* following characters: + - = . _ : / @</p>
1382-
* @public
1383-
*/
1384-
value?: string | undefined;
1385-
}
1386-
13871394
/**
13881395
* <p>Describes an Amazon Lightsail bucket.</p>
13891396
* @public

clients/client-lightsail/src/models/models_1.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3247,6 +3247,13 @@ export interface PutAlarmRequest {
32473247
* @public
32483248
*/
32493249
notificationEnabled?: boolean | undefined;
3250+
3251+
/**
3252+
* <p>The tag keys and optional values to add to the alarm during create.</p>
3253+
* <p>Use the <code>TagResource</code> action to tag a resource after it's created.</p>
3254+
* @public
3255+
*/
3256+
tags?: Tag[] | undefined;
32503257
}
32513258

32523259
/**

clients/client-lightsail/src/schemas/schemas_0.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,8 +1301,8 @@ export var AddOnRequest$: StaticStructureSchema = [3, n0, _AOR,
13011301
];
13021302
export var Alarm$: StaticStructureSchema = [3, n0, _A,
13031303
0,
1304-
[_n, _a, _cA, _l, _rT, _sC, _mRI, _cO, _eP, _p, _th, _dTA, _tMD, _sta, _mN, _stat, _u, _cP, _nT, _nE],
1305-
[0, 0, 4, () => ResourceLocation$, 0, 0, () => MonitoredResourceInfo$, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 64 | 0, 64 | 0, 2]
1304+
[_n, _a, _cA, _l, _rT, _sC, _mRI, _cO, _eP, _p, _th, _dTA, _tMD, _sta, _mN, _stat, _u, _cP, _nT, _nE, _ta],
1305+
[0, 0, 4, () => ResourceLocation$, 0, 0, () => MonitoredResourceInfo$, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 64 | 0, 64 | 0, 2, () => TagList]
13061306
];
13071307
export var AllocateStaticIpRequest$: StaticStructureSchema = [3, n0, _ASIR,
13081308
0,
@@ -3046,8 +3046,8 @@ export var PrivateRegistryAccessRequest$: StaticStructureSchema = [3, n0, _PRAR,
30463046
];
30473047
export var PutAlarmRequest$: StaticStructureSchema = [3, n0, _PAR,
30483048
0,
3049-
[_aN, _mN, _mRN, _cO, _th, _eP, _dTA, _tMD, _cP, _nT, _nE],
3050-
[0, 0, 0, 0, 1, 1, 1, 0, 64 | 0, 64 | 0, 2], 6
3049+
[_aN, _mN, _mRN, _cO, _th, _eP, _dTA, _tMD, _cP, _nT, _nE, _ta],
3050+
[0, 0, 0, 0, 1, 1, 1, 0, 64 | 0, 64 | 0, 2, () => TagList], 6
30513051
];
30523052
export var PutAlarmResult$: StaticStructureSchema = [3, n0, _PARu,
30533053
0,

codegen/sdk-codegen/aws-models/lightsail.json

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,12 @@
486486
"traits": {
487487
"smithy.api#documentation": "<p>Indicates whether the alarm is enabled.</p>"
488488
}
489+
},
490+
"tags": {
491+
"target": "com.amazonaws.lightsail#TagList",
492+
"traits": {
493+
"smithy.api#documentation": "<p>The tag keys and optional values for the resource. For more information about tags in\n Lightsail, see the <a href=\"https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-tags\">Amazon Lightsail Developer Guide</a>.</p>"
494+
}
489495
}
490496
},
491497
"traits": {
@@ -3815,7 +3821,7 @@
38153821
}
38163822
],
38173823
"traits": {
3818-
"smithy.api#documentation": "<p>Creates an email or SMS text message contact method.</p>\n <p>A contact method is used to send you notifications about your Amazon Lightsail resources.\n You can add one email address and one mobile phone number contact method in each Amazon Web Services Region. However, SMS text messaging is not supported in some Amazon Web Services\n Regions, and SMS text messages cannot be sent to some countries/regions. For more information,\n see <a href=\"https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-notifications\">Notifications in Amazon Lightsail</a>.</p>",
3824+
"smithy.api#documentation": "<p>Creates an email or SMS text message contact method.</p>\n <p>A contact method is used to send you notifications about your Amazon Lightsail resources.\n You can add one email address and one mobile phone number contact method in each Amazon Web Services Region. However, SMS text messaging is not supported in some Amazon Web Services\n Regions, and SMS text messages cannot be sent to some countries/regions. For more information,\n see <a href=\"https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-notifications\">Notifications in Amazon Lightsail</a>.</p>\n <p>The <code>create contact method</code> operation supports tag-based access control via request\n tags. For more information, see the <a href=\"https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-controlling-access-using-tags\">Lightsail Developer Guide</a>.</p>",
38193825
"smithy.api#http": {
38203826
"method": "POST",
38213827
"uri": "/ls/api/2016-11-28/CreateContactMethod",
@@ -19664,7 +19670,7 @@
1966419670
}
1966519671
],
1966619672
"traits": {
19667-
"smithy.api#documentation": "<p>Creates or updates an alarm, and associates it with the specified metric.</p>\n <p>An alarm is used to monitor a single metric for one of your resources. When a metric\n condition is met, the alarm can notify you by email, SMS text message, and a banner displayed\n on the Amazon Lightsail console. For more information, see <a href=\"https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-alarms\">Alarms\n in Amazon Lightsail</a>.</p>\n <p>When this action creates an alarm, the alarm state is immediately set to\n <code>INSUFFICIENT_DATA</code>. The alarm is then evaluated and its state is set\n appropriately. Any actions associated with the new state are then executed.</p>\n <p>When you update an existing alarm, its state is left unchanged, but the update completely\n overwrites the previous configuration of the alarm. The alarm is then evaluated with the\n updated configuration.</p>",
19673+
"smithy.api#documentation": "<p>Creates or updates an alarm, and associates it with the specified metric.</p>\n <p>An alarm is used to monitor a single metric for one of your resources. When a metric\n condition is met, the alarm can notify you by email, SMS text message, and a banner displayed\n on the Amazon Lightsail console. For more information, see <a href=\"https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-alarms\">Alarms\n in Amazon Lightsail</a>.</p>\n <p>When this action creates an alarm, the alarm state is immediately set to\n <code>INSUFFICIENT_DATA</code>. The alarm is then evaluated and its state is set\n appropriately. Any actions associated with the new state are then executed.</p>\n <p>When you update an existing alarm, its state is left unchanged, but the update completely\n overwrites the previous configuration of the alarm. The alarm is then evaluated with the\n updated configuration.</p>\n <p>The <code>put alarm</code> operation supports tag-based access control via request\n tags. For more information, see the <a href=\"https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-controlling-access-using-tags\">Lightsail Developer Guide</a>.</p>",
1966819674
"smithy.api#http": {
1966919675
"method": "POST",
1967019676
"uri": "/ls/api/2016-11-28/PutAlarm",
@@ -19746,6 +19752,12 @@
1974619752
"traits": {
1974719753
"smithy.api#documentation": "<p>Indicates whether the alarm is enabled.</p>\n <p>Notifications are enabled by default if you don't specify this parameter.</p>"
1974819754
}
19755+
},
19756+
"tags": {
19757+
"target": "com.amazonaws.lightsail#TagList",
19758+
"traits": {
19759+
"smithy.api#documentation": "<p>The tag keys and optional values to add to the alarm during create.</p>\n <p>Use the <code>TagResource</code> action to tag a resource after it's created.</p>"
19760+
}
1974919761
}
1975019762
},
1975119763
"traits": {

0 commit comments

Comments
 (0)