Skip to content

Commit 3aff9aa

Browse files
author
awstools
committed
feat(client-ssm-incidents): Adds support for tagging incident-record on creation by providing incident tags in the template within a response-plan.
1 parent c700486 commit 3aff9aa

File tree

3 files changed

+88
-17
lines changed

3 files changed

+88
-17
lines changed

clients/client-ssm-incidents/src/models/models_0.ts

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ export type DynamicSsmParameterValue =
3636

3737
export namespace DynamicSsmParameterValue {
3838
/**
39-
* <p>Variable dynamic parameters. A parameter value is determined when an incident is created.</p>
39+
* <p>Variable dynamic parameters. A parameter value is determined when an incident is
40+
* created.</p>
4041
*/
4142
export interface VariableMember {
4243
variable: VariableType | string;
@@ -105,7 +106,8 @@ export interface SsmAutomation {
105106
parameters?: Record<string, string[]>;
106107

107108
/**
108-
* <p>The key-value pair to resolve dynamic parameter values when processing a Systems Manager Automation runbook.</p>
109+
* <p>The key-value pair to resolve dynamic parameter values when processing a Systems Manager
110+
* Automation runbook.</p>
109111
*/
110112
dynamicParameters?: Record<string, DynamicSsmParameterValue>;
111113
}
@@ -723,6 +725,11 @@ export interface IncidentTemplate {
723725
* incident.</p>
724726
*/
725727
notificationTargets?: NotificationTargetItem[];
728+
729+
/**
730+
* <p>Tags to apply to an incident when calling the <code>StartIncident</code> API action.</p>
731+
*/
732+
incidentTags?: Record<string, string>;
726733
}
727734

728735
export namespace IncidentTemplate {
@@ -2401,7 +2408,8 @@ export interface StartIncidentInput {
24012408

24022409
/**
24032410
* <p>The Amazon Resource Name (ARN) of the response plan that pre-defines summary, chat
2404-
* channels, Amazon SNS topics, runbooks, title, and impact of the incident. </p>
2411+
* channels, Amazon SNS topics, runbooks, title, and impact of the incident.
2412+
* </p>
24052413
*/
24062414
responsePlanArn: string | undefined;
24072415

@@ -2430,12 +2438,12 @@ export interface StartIncidentInput {
24302438
* </li>
24312439
* <li>
24322440
* <p>
2433-
* <code>3</code> - Medium impact, the application is providing reduced service
2441+
* <code>3</code> - Medium impact, the application is providing reduced service
24342442
* to customers.</p>
24352443
* </li>
24362444
* <li>
24372445
* <p>
2438-
* <code>4</code> - Low impact, customer might aren't impacted by the problem
2446+
* <code>4</code> - Low impact, customer might aren't impacted by the problem
24392447
* yet.</p>
24402448
* </li>
24412449
* <li>
@@ -2860,23 +2868,23 @@ export interface UpdateResponsePlanInput {
28602868
* </p>
28612869
* <ul>
28622870
* <li>
2863-
* <p>
2871+
* <p>
28642872
* <code>5</code> - Severe impact</p>
28652873
* </li>
28662874
* <li>
2867-
* <p>
2875+
* <p>
28682876
* <code>4</code> - High impact</p>
28692877
* </li>
28702878
* <li>
2871-
* <p>
2879+
* <p>
28722880
* <code>3</code> - Medium impact</p>
28732881
* </li>
28742882
* <li>
2875-
* <p>
2883+
* <p>
28762884
* <code>2</code> - Low impact</p>
28772885
* </li>
28782886
* <li>
2879-
* <p>
2887+
* <p>
28802888
* <code>1</code> - No impact</p>
28812889
* </li>
28822890
* </ul>
@@ -2909,14 +2917,22 @@ export interface UpdateResponsePlanInput {
29092917
chatChannel?: ChatChannel;
29102918

29112919
/**
2912-
* <p>The contacts and escalation plans that Incident Manager engages at the start of the incident.</p>
2920+
* <p>The contacts and escalation plans that Incident Manager engages at the start of the
2921+
* incident.</p>
29132922
*/
29142923
engagements?: string[];
29152924

29162925
/**
29172926
* <p>The actions that this response plan takes at the beginning of an incident.</p>
29182927
*/
29192928
actions?: Action[];
2929+
2930+
/**
2931+
* <p>Tags to apply to an incident when calling the <code>StartIncident</code> API action.
2932+
* To call this action, you must also have permission to call the <code>TagResource</code>
2933+
* API action for the incident record resource.</p>
2934+
*/
2935+
incidentTemplateTags?: Record<string, string>;
29202936
}
29212937

29222938
export namespace UpdateResponsePlanInput {

clients/client-ssm-incidents/src/protocols/Aws_restJson1.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -911,6 +911,10 @@ export const serializeAws_restJson1UpdateResponsePlanCommand = async (
911911
}),
912912
...(input.incidentTemplateSummary !== undefined &&
913913
input.incidentTemplateSummary !== null && { incidentTemplateSummary: input.incidentTemplateSummary }),
914+
...(input.incidentTemplateTags !== undefined &&
915+
input.incidentTemplateTags !== null && {
916+
incidentTemplateTags: serializeAws_restJson1TagMapUpdate(input.incidentTemplateTags, context),
917+
}),
914918
...(input.incidentTemplateTitle !== undefined &&
915919
input.incidentTemplateTitle !== null && { incidentTemplateTitle: input.incidentTemplateTitle }),
916920
});
@@ -2902,6 +2906,8 @@ const serializeAws_restJson1IncidentTemplate = (input: IncidentTemplate, context
29022906
return {
29032907
...(input.dedupeString !== undefined && input.dedupeString !== null && { dedupeString: input.dedupeString }),
29042908
...(input.impact !== undefined && input.impact !== null && { impact: input.impact }),
2909+
...(input.incidentTags !== undefined &&
2910+
input.incidentTags !== null && { incidentTags: serializeAws_restJson1TagMap(input.incidentTags, context) }),
29052911
...(input.notificationTargets !== undefined &&
29062912
input.notificationTargets !== null && {
29072913
notificationTargets: serializeAws_restJson1NotificationTargetSet(input.notificationTargets, context),
@@ -3067,6 +3073,18 @@ const serializeAws_restJson1TagMap = (input: Record<string, string>, context: __
30673073
}, {});
30683074
};
30693075

3076+
const serializeAws_restJson1TagMapUpdate = (input: Record<string, string>, context: __SerdeContext): any => {
3077+
return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {
3078+
if (value === null) {
3079+
return acc;
3080+
}
3081+
return {
3082+
...acc,
3083+
[key]: value,
3084+
};
3085+
}, {});
3086+
};
3087+
30703088
const serializeAws_restJson1TriggerDetails = (input: TriggerDetails, context: __SerdeContext): any => {
30713089
return {
30723090
...(input.rawData !== undefined && input.rawData !== null && { rawData: input.rawData }),
@@ -3326,6 +3344,10 @@ const deserializeAws_restJson1IncidentTemplate = (output: any, context: __SerdeC
33263344
return {
33273345
dedupeString: __expectString(output.dedupeString),
33283346
impact: __expectInt32(output.impact),
3347+
incidentTags:
3348+
output.incidentTags !== undefined && output.incidentTags !== null
3349+
? deserializeAws_restJson1TagMap(output.incidentTags, context)
3350+
: undefined,
33293351
notificationTargets:
33303352
output.notificationTargets !== undefined && output.notificationTargets !== null
33313353
? deserializeAws_restJson1NotificationTargetSet(output.notificationTargets, context)

codegen/sdk-codegen/aws-models/ssm-incidents.json

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,7 @@
798798
"variable": {
799799
"target": "com.amazonaws.ssmincidents#VariableType",
800800
"traits": {
801-
"smithy.api#documentation": "<p>Variable dynamic parameters. A parameter value is determined when an incident is created.</p>",
801+
"smithy.api#documentation": "<p>Variable dynamic parameters. A parameter value is determined when an incident is\n created.</p>",
802802
"smithy.api#tags": ["logs_investigations"]
803803
}
804804
}
@@ -1693,6 +1693,12 @@
16931693
"traits": {
16941694
"smithy.api#documentation": "<p>The Amazon SNS targets that are notified when updates are made to an\n incident.</p>"
16951695
}
1696+
},
1697+
"incidentTags": {
1698+
"target": "com.amazonaws.ssmincidents#TagMap",
1699+
"traits": {
1700+
"smithy.api#documentation": "<p>Tags to apply to an incident when calling the <code>StartIncident</code> API action.</p>"
1701+
}
16961702
}
16971703
},
16981704
"traits": {
@@ -3129,7 +3135,7 @@
31293135
"dynamicParameters": {
31303136
"target": "com.amazonaws.ssmincidents#DynamicSsmParameters",
31313137
"traits": {
3132-
"smithy.api#documentation": "<p>The key-value pair to resolve dynamic parameter values when processing a Systems Manager Automation runbook.</p>"
3138+
"smithy.api#documentation": "<p>The key-value pair to resolve dynamic parameter values when processing a Systems Manager\n Automation runbook.</p>"
31333139
}
31343140
}
31353141
},
@@ -3252,7 +3258,7 @@
32523258
"responsePlanArn": {
32533259
"target": "com.amazonaws.ssmincidents#Arn",
32543260
"traits": {
3255-
"smithy.api#documentation": "<p>The Amazon Resource Name (ARN) of the response plan that pre-defines summary, chat\n channels, Amazon SNS topics, runbooks, title, and impact of the incident. </p>",
3261+
"smithy.api#documentation": "<p>The Amazon Resource Name (ARN) of the response plan that pre-defines summary, chat\n channels, Amazon SNS topics, runbooks, title, and impact of the incident.\n </p>",
32563262
"smithy.api#required": {},
32573263
"smithy.api#tags": ["logs_investigations"]
32583264
}
@@ -3266,7 +3272,7 @@
32663272
"impact": {
32673273
"target": "com.amazonaws.ssmincidents#Impact",
32683274
"traits": {
3269-
"smithy.api#documentation": "<p>Defines the impact to the customers. Providing an impact overwrites the impact\n provided by a response plan.</p>\n <p class=\"title\">\n <b>Possible impacts:</b>\n </p>\n <ul>\n <li>\n <p>\n <code>1</code> - Critical impact, this typically relates to full application\n failure that impacts many to all customers. </p>\n </li>\n <li>\n <p>\n <code>2</code> - High impact, partial application failure with impact to many\n customers.</p>\n </li>\n <li>\n <p>\n <code>3</code> - Medium impact, the application is providing reduced service\n to customers.</p>\n </li>\n <li>\n <p>\n <code>4</code> - Low impact, customer might aren't impacted by the problem\n yet.</p>\n </li>\n <li>\n <p>\n <code>5</code> - No impact, customers aren't currently impacted but urgent\n action is needed to avoid impact.</p>\n </li>\n </ul>"
3275+
"smithy.api#documentation": "<p>Defines the impact to the customers. Providing an impact overwrites the impact\n provided by a response plan.</p>\n <p class=\"title\">\n <b>Possible impacts:</b>\n </p>\n <ul>\n <li>\n <p>\n <code>1</code> - Critical impact, this typically relates to full application\n failure that impacts many to all customers. </p>\n </li>\n <li>\n <p>\n <code>2</code> - High impact, partial application failure with impact to many\n customers.</p>\n </li>\n <li>\n <p>\n <code>3</code> - Medium impact, the application is providing reduced service\n to customers.</p>\n </li>\n <li>\n <p>\n <code>4</code> - Low impact, customer might aren't impacted by the problem\n yet.</p>\n </li>\n <li>\n <p>\n <code>5</code> - No impact, customers aren't currently impacted but urgent\n action is needed to avoid impact.</p>\n </li>\n </ul>"
32703276
}
32713277
},
32723278
"triggerDetails": {
@@ -3355,6 +3361,27 @@
33553361
}
33563362
}
33573363
},
3364+
"com.amazonaws.ssmincidents#TagMapUpdate": {
3365+
"type": "map",
3366+
"key": {
3367+
"target": "com.amazonaws.ssmincidents#TagKey",
3368+
"traits": {
3369+
"smithy.api#tags": ["logs_investigations"]
3370+
}
3371+
},
3372+
"value": {
3373+
"target": "com.amazonaws.ssmincidents#TagValue",
3374+
"traits": {
3375+
"smithy.api#tags": ["logs_investigations"]
3376+
}
3377+
},
3378+
"traits": {
3379+
"smithy.api#length": {
3380+
"min": 0,
3381+
"max": 50
3382+
}
3383+
}
3384+
},
33583385
"com.amazonaws.ssmincidents#TagResource": {
33593386
"type": "operation",
33603387
"input": {
@@ -4045,7 +4072,7 @@
40454072
"incidentTemplateImpact": {
40464073
"target": "com.amazonaws.ssmincidents#Impact",
40474074
"traits": {
4048-
"smithy.api#documentation": "<p>Defines the impact to the customers. Providing an impact overwrites the impact\n provided by a response plan.</p>\n <p class=\"title\">\n <b>Possible impacts:</b>\n </p>\n <ul>\n <li>\n <p>\n <code>5</code> - Severe impact</p>\n </li>\n <li>\n <p>\n <code>4</code> - High impact</p>\n </li>\n <li>\n <p>\n <code>3</code> - Medium impact</p>\n </li>\n <li>\n <p>\n <code>2</code> - Low impact</p>\n </li>\n <li>\n <p>\n <code>1</code> - No impact</p>\n </li>\n </ul>"
4075+
"smithy.api#documentation": "<p>Defines the impact to the customers. Providing an impact overwrites the impact\n provided by a response plan.</p>\n <p class=\"title\">\n <b>Possible impacts:</b>\n </p>\n <ul>\n <li>\n <p>\n <code>5</code> - Severe impact</p>\n </li>\n <li>\n <p>\n <code>4</code> - High impact</p>\n </li>\n <li>\n <p>\n <code>3</code> - Medium impact</p>\n </li>\n <li>\n <p>\n <code>2</code> - Low impact</p>\n </li>\n <li>\n <p>\n <code>1</code> - No impact</p>\n </li>\n </ul>"
40494076
}
40504077
},
40514078
"incidentTemplateSummary": {
@@ -4076,14 +4103,20 @@
40764103
"engagements": {
40774104
"target": "com.amazonaws.ssmincidents#EngagementSet",
40784105
"traits": {
4079-
"smithy.api#documentation": "<p>The contacts and escalation plans that Incident Manager engages at the start of the incident.</p>"
4106+
"smithy.api#documentation": "<p>The contacts and escalation plans that Incident Manager engages at the start of the\n incident.</p>"
40804107
}
40814108
},
40824109
"actions": {
40834110
"target": "com.amazonaws.ssmincidents#ActionsList",
40844111
"traits": {
40854112
"smithy.api#documentation": "<p>The actions that this response plan takes at the beginning of an incident.</p>"
40864113
}
4114+
},
4115+
"incidentTemplateTags": {
4116+
"target": "com.amazonaws.ssmincidents#TagMapUpdate",
4117+
"traits": {
4118+
"smithy.api#documentation": "<p>Tags to apply to an incident when calling the <code>StartIncident</code> API action.\n To call this action, you must also have permission to call the <code>TagResource</code>\n API action for the incident record resource.</p>"
4119+
}
40874120
}
40884121
}
40894122
},

0 commit comments

Comments
 (0)