Skip to content

Commit

Permalink
feat(client-ssm): Added offset support for specifying the number of d…
Browse files Browse the repository at this point in the history
…ays to wait after the date and time specified by a CRON expression when creating SSM association.
  • Loading branch information
awstools committed Apr 19, 2022
1 parent 047ace0 commit e8b6d98
Show file tree
Hide file tree
Showing 6 changed files with 120 additions and 11 deletions.
6 changes: 3 additions & 3 deletions clients/client-ssm/src/SSM.ts
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ import { SSMClient } from "./SSMClient";
export class SSM extends SSMClient {
/**
* <p>Adds or overwrites one or more tags for the specified resource. Tags are metadata that you
* can assign to your documents, managed nodes, maintenance windows, Parameter Store parameters, and
* can assign to your automations, documents, managed nodes, maintenance windows, Parameter Store parameters, and
* patch baselines. Tags enable you to categorize your resources in different ways, for example, by
* purpose, owner, or environment. Each tag consists of a key and an optional value, both of which
* you define. For example, you could define a set of tags for your account's managed nodes that
Expand Down Expand Up @@ -744,11 +744,11 @@ export class SSM extends SSMClient {
* </p>
* </li>
* </ul>
* <p>Each resource can have a maximum of 50 tags.</p>
* <p>Most resources can have a maximum of 50 tags. Automations can have a maximum of 5 tags.</p>
* <p>We recommend that you devise a set of tag keys that meets your needs for each resource type.
* Using a consistent set of tag keys makes it easier for you to manage your resources. You can
* search and filter the resources based on the tags you add. Tags don't have any semantic meaning
* to and are interpreted strictly as a string of characters. </p>
* to and are interpreted strictly as a string of characters.</p>
* <p>For more information about using tags with Amazon Elastic Compute Cloud (Amazon EC2) instances, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html">Tagging your Amazon EC2
* resources</a> in the <i>Amazon EC2 User Guide</i>.</p>
*/
Expand Down
6 changes: 3 additions & 3 deletions clients/client-ssm/src/commands/AddTagsToResourceCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export interface AddTagsToResourceCommandOutput extends AddTagsToResourceResult,

/**
* <p>Adds or overwrites one or more tags for the specified resource. Tags are metadata that you
* can assign to your documents, managed nodes, maintenance windows, Parameter Store parameters, and
* can assign to your automations, documents, managed nodes, maintenance windows, Parameter Store parameters, and
* patch baselines. Tags enable you to categorize your resources in different ways, for example, by
* purpose, owner, or environment. Each tag consists of a key and an optional value, both of which
* you define. For example, you could define a set of tags for your account's managed nodes that
Expand Down Expand Up @@ -60,11 +60,11 @@ export interface AddTagsToResourceCommandOutput extends AddTagsToResourceResult,
* </p>
* </li>
* </ul>
* <p>Each resource can have a maximum of 50 tags.</p>
* <p>Most resources can have a maximum of 50 tags. Automations can have a maximum of 5 tags.</p>
* <p>We recommend that you devise a set of tag keys that meets your needs for each resource type.
* Using a consistent set of tag keys makes it easier for you to manage your resources. You can
* search and filter the resources based on the tags you add. Tags don't have any semantic meaning
* to and are interpreted strictly as a string of characters. </p>
* to and are interpreted strictly as a string of characters.</p>
* <p>For more information about using tags with Amazon Elastic Compute Cloud (Amazon EC2) instances, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html">Tagging your Amazon EC2
* resources</a> in the <i>Amazon EC2 User Guide</i>.</p>
* @example
Expand Down
24 changes: 24 additions & 0 deletions clients/client-ssm/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ export interface AddTagsToResourceRequest {
* <code>PatchBaseline</code>: <code>pb-012345abcde</code>
* </p>
* <p>
* <code>Automation</code>: <code>example-c160-4567-8519-012345abcde</code>
* </p>
* <p>
* <code>OpsMetadata</code> object: <code>ResourceID</code> for tagging is created from the
* Amazon Resource Name (ARN) for the object. Specifically, <code>ResourceID</code> is created from
* the strings that come after the word <code>opsmetadata</code> in the ARN. For example, an
Expand Down Expand Up @@ -1228,6 +1231,17 @@ export interface CreateAssociationRequest {
* accounts.</p>
*/
TargetLocations?: TargetLocation[];

/**
* <p>Number of days to wait after the scheduled day to run an association. For example, if you
* specified a cron schedule of <code>cron(0 0 ? * THU#2 *)</code>, you could specify an offset of 3
* to run the association each Sunday after the second Thursday of the month. For more information about cron schedules for associations, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/reference-cron-and-rate-expressions.html">Reference: Cron and rate expressions for Systems Manager</a> in the <i>Amazon Web Services Systems Manager User Guide</i>. </p>
* <note>
* <p>To use offsets, you must specify the <code>ApplyOnlyAtCronInterval</code> parameter. This
* option tells the system not to run an association immediately after you create it. </p>
* </note>
*/
ScheduleOffset?: number;
}

export namespace CreateAssociationRequest {
Expand Down Expand Up @@ -1468,6 +1482,11 @@ export interface AssociationDescription {
* association.</p>
*/
TargetLocations?: TargetLocation[];

/**
* <p>Number of days to wait after the scheduled day to run an association.</p>
*/
ScheduleOffset?: number;
}

export namespace AssociationDescription {
Expand Down Expand Up @@ -1772,6 +1791,11 @@ export interface CreateAssociationBatchRequestEntry {
* <p>Use this action to create an association in multiple Regions and multiple accounts.</p>
*/
TargetLocations?: TargetLocation[];

/**
* <p>Number of days to wait after the scheduled day to run an association.</p>
*/
ScheduleOffset?: number;
}

export namespace CreateAssociationBatchRequestEntry {
Expand Down
26 changes: 25 additions & 1 deletion clients/client-ssm/src/models/models_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4518,6 +4518,11 @@ export interface Association {
* <p>The association name.</p>
*/
AssociationName?: string;

/**
* <p>Number of days to wait after the scheduled day to run an association.</p>
*/
ScheduleOffset?: number;
}

export namespace Association {
Expand Down Expand Up @@ -4702,6 +4707,11 @@ export interface AssociationVersionInfo {
* when this association version was created.</p>
*/
TargetLocations?: TargetLocation[];

/**
* <p>Number of days to wait after the scheduled day to run an association.</p>
*/
ScheduleOffset?: number;
}

export namespace AssociationVersionInfo {
Expand Down Expand Up @@ -8971,6 +8981,9 @@ export interface RemoveTagsFromResourceRequest {
* <p>The ID of the resource from which you want to remove tags. For example:</p>
* <p>ManagedInstance: mi-012345abcde</p>
* <p>MaintenanceWindow: mw-012345abcde</p>
* <p>
* <code>Automation</code>: <code>example-c160-4567-8519-012345abcde</code>
* </p>
* <p>PatchBaseline: pb-012345abcde</p>
* <p>OpsMetadata object: <code>ResourceID</code> for tagging is created from the Amazon Resource
* Name (ARN) for the object. Specifically, <code>ResourceID</code> is created from the strings that
Expand Down Expand Up @@ -9700,7 +9713,7 @@ export interface StartAutomationExecutionRequest {
* </li>
* </ul>
* <note>
* <p>To add tags to an existing patch baseline, use the <a>AddTagsToResource</a>
* <p>To add tags to an existing automation, use the <a>AddTagsToResource</a>
* operation.</p>
* </note>
*/
Expand Down Expand Up @@ -10314,6 +10327,17 @@ export interface UpdateAssociationRequest {
* accounts.</p>
*/
TargetLocations?: TargetLocation[];

/**
* <p>Number of days to wait after the scheduled day to run an association. For example, if you
* specified a cron schedule of <code>cron(0 0 ? * THU#2 *)</code>, you could specify an offset of 3
* to run the association each Sunday after the second Thursday of the month. For more information about cron schedules for associations, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/reference-cron-and-rate-expressions.html">Reference: Cron and rate expressions for Systems Manager</a> in the <i>Amazon Web Services Systems Manager User Guide</i>. </p>
* <note>
* <p>To use offsets, you must specify the <code>ApplyOnlyAtCronInterval</code> parameter. This
* option tells the system not to run an association immediately after you create it. </p>
* </note>
*/
ScheduleOffset?: number;
}

export namespace UpdateAssociationRequest {
Expand Down
10 changes: 10 additions & 0 deletions clients/client-ssm/src/protocols/Aws_json1_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11705,6 +11705,8 @@ const serializeAws_json1_1CreateAssociationBatchRequestEntry = (
input.Parameters !== null && { Parameters: serializeAws_json1_1Parameters(input.Parameters, context) }),
...(input.ScheduleExpression !== undefined &&
input.ScheduleExpression !== null && { ScheduleExpression: input.ScheduleExpression }),
...(input.ScheduleOffset !== undefined &&
input.ScheduleOffset !== null && { ScheduleOffset: input.ScheduleOffset }),
...(input.SyncCompliance !== undefined &&
input.SyncCompliance !== null && { SyncCompliance: input.SyncCompliance }),
...(input.TargetLocations !== undefined &&
Expand Down Expand Up @@ -11750,6 +11752,8 @@ const serializeAws_json1_1CreateAssociationRequest = (
input.Parameters !== null && { Parameters: serializeAws_json1_1Parameters(input.Parameters, context) }),
...(input.ScheduleExpression !== undefined &&
input.ScheduleExpression !== null && { ScheduleExpression: input.ScheduleExpression }),
...(input.ScheduleOffset !== undefined &&
input.ScheduleOffset !== null && { ScheduleOffset: input.ScheduleOffset }),
...(input.SyncCompliance !== undefined &&
input.SyncCompliance !== null && { SyncCompliance: input.SyncCompliance }),
...(input.TargetLocations !== undefined &&
Expand Down Expand Up @@ -14861,6 +14865,8 @@ const serializeAws_json1_1UpdateAssociationRequest = (
input.Parameters !== null && { Parameters: serializeAws_json1_1Parameters(input.Parameters, context) }),
...(input.ScheduleExpression !== undefined &&
input.ScheduleExpression !== null && { ScheduleExpression: input.ScheduleExpression }),
...(input.ScheduleOffset !== undefined &&
input.ScheduleOffset !== null && { ScheduleOffset: input.ScheduleOffset }),
...(input.SyncCompliance !== undefined &&
input.SyncCompliance !== null && { SyncCompliance: input.SyncCompliance }),
...(input.TargetLocations !== undefined &&
Expand Down Expand Up @@ -15259,6 +15265,7 @@ const deserializeAws_json1_1Association = (output: any, context: __SerdeContext)
? deserializeAws_json1_1AssociationOverview(output.Overview, context)
: undefined,
ScheduleExpression: __expectString(output.ScheduleExpression),
ScheduleOffset: __expectInt32(output.ScheduleOffset),
Targets:
output.Targets !== undefined && output.Targets !== null
? deserializeAws_json1_1Targets(output.Targets, context)
Expand Down Expand Up @@ -15319,6 +15326,7 @@ const deserializeAws_json1_1AssociationDescription = (output: any, context: __Se
? deserializeAws_json1_1Parameters(output.Parameters, context)
: undefined,
ScheduleExpression: __expectString(output.ScheduleExpression),
ScheduleOffset: __expectInt32(output.ScheduleOffset),
Status:
output.Status !== undefined && output.Status !== null
? deserializeAws_json1_1AssociationStatus(output.Status, context)
Expand Down Expand Up @@ -15525,6 +15533,7 @@ const deserializeAws_json1_1AssociationVersionInfo = (output: any, context: __Se
? deserializeAws_json1_1Parameters(output.Parameters, context)
: undefined,
ScheduleExpression: __expectString(output.ScheduleExpression),
ScheduleOffset: __expectInt32(output.ScheduleOffset),
SyncCompliance: __expectString(output.SyncCompliance),
TargetLocations:
output.TargetLocations !== undefined && output.TargetLocations !== null
Expand Down Expand Up @@ -16173,6 +16182,7 @@ const deserializeAws_json1_1CreateAssociationBatchRequestEntry = (
? deserializeAws_json1_1Parameters(output.Parameters, context)
: undefined,
ScheduleExpression: __expectString(output.ScheduleExpression),
ScheduleOffset: __expectInt32(output.ScheduleOffset),
SyncCompliance: __expectString(output.SyncCompliance),
TargetLocations:
output.TargetLocations !== undefined && output.TargetLocations !== null
Expand Down
Loading

0 comments on commit e8b6d98

Please sign in to comment.