Skip to content

Commit

Permalink
feat(client-ssm): This release adds an optional Duration parameter to…
Browse files Browse the repository at this point in the history
… StateManager Associations. This allows customers to specify how long an apply-only-on-cron association execution should run. Once the specified Duration is out all the ongoing cancellable commands or automations are cancelled.
  • Loading branch information
awstools committed Jan 31, 2024
1 parent 1751692 commit c587e27
Show file tree
Hide file tree
Showing 13 changed files with 181 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ export interface CreateAssociationBatchCommandOutput extends CreateAssociationBa
* },
* ],
* ScheduleOffset: Number("int"),
* Duration: Number("int"),
* TargetMaps: [ // TargetMaps
* { // TargetMap
* "<keys>": [ // TargetMapValueList
Expand Down Expand Up @@ -203,6 +204,7 @@ export interface CreateAssociationBatchCommandOutput extends CreateAssociationBa
* // },
* // ],
* // ScheduleOffset: Number("int"),
* // Duration: Number("int"),
* // TargetMaps: [ // TargetMaps
* // { // TargetMap
* // "<keys>": [ // TargetMapValueList
Expand Down Expand Up @@ -278,6 +280,7 @@ export interface CreateAssociationBatchCommandOutput extends CreateAssociationBa
* // },
* // ],
* // ScheduleOffset: Number("int"),
* // Duration: Number("int"),
* // TargetMaps: [
* // {
* // "<keys>": [
Expand Down
2 changes: 2 additions & 0 deletions clients/client-ssm/src/commands/CreateAssociationCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export interface CreateAssociationCommandOutput extends CreateAssociationResult,
* },
* ],
* ScheduleOffset: Number("int"),
* Duration: Number("int"),
* TargetMaps: [ // TargetMaps
* { // TargetMap
* "<keys>": [ // TargetMapValueList
Expand Down Expand Up @@ -207,6 +208,7 @@ export interface CreateAssociationCommandOutput extends CreateAssociationResult,
* // },
* // ],
* // ScheduleOffset: Number("int"),
* // Duration: Number("int"),
* // TargetMaps: [ // TargetMaps
* // { // TargetMap
* // "<keys>": [ // TargetMapValueList
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ export interface DescribeAssociationCommandOutput extends DescribeAssociationRes
* // },
* // ],
* // ScheduleOffset: Number("int"),
* // Duration: Number("int"),
* // TargetMaps: [ // TargetMaps
* // { // TargetMap
* // "<keys>": [ // TargetMapValueList
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ export interface DescribeAvailablePatchesCommandOutput extends DescribeAvailable
/**
* @public
* <p>Lists all patches eligible to be included in a patch baseline.</p>
* <note>
* <p>Currently, <code>DescribeAvailablePatches</code> supports only the Amazon Linux 1, Amazon
* Linux 2, and Windows Server operating systems.</p>
* </note>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export interface ListAssociationVersionsCommandOutput extends ListAssociationVer
* // },
* // ],
* // ScheduleOffset: Number("int"),
* // Duration: Number("int"),
* // TargetMaps: [ // TargetMaps
* // { // TargetMap
* // "<keys>": [ // TargetMapValueList
Expand Down
1 change: 1 addition & 0 deletions clients/client-ssm/src/commands/ListAssociationsCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export interface ListAssociationsCommandOutput extends ListAssociationsResult, _
* // ScheduleExpression: "STRING_VALUE",
* // AssociationName: "STRING_VALUE",
* // ScheduleOffset: Number("int"),
* // Duration: Number("int"),
* // TargetMaps: [ // TargetMaps
* // { // TargetMap
* // "<keys>": [ // TargetMapValueList
Expand Down
2 changes: 2 additions & 0 deletions clients/client-ssm/src/commands/UpdateAssociationCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ export interface UpdateAssociationCommandOutput extends UpdateAssociationResult,
* },
* ],
* ScheduleOffset: Number("int"),
* Duration: Number("int"),
* TargetMaps: [ // TargetMaps
* { // TargetMap
* "<keys>": [ // TargetMapValueList
Expand Down Expand Up @@ -212,6 +213,7 @@ export interface UpdateAssociationCommandOutput extends UpdateAssociationResult,
* // },
* // ],
* // ScheduleOffset: Number("int"),
* // Duration: Number("int"),
* // TargetMaps: [ // TargetMaps
* // { // TargetMap
* // "<keys>": [ // TargetMapValueList
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ export interface UpdateAssociationStatusCommandOutput extends UpdateAssociationS
* // },
* // ],
* // ScheduleOffset: Number("int"),
* // Duration: Number("int"),
* // TargetMaps: [ // TargetMaps
* // { // TargetMap
* // "<keys>": [ // TargetMapValueList
Expand Down
60 changes: 58 additions & 2 deletions clients/client-ssm/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1329,6 +1329,28 @@ export interface CreateAssociationRequest {
*/
ScheduleOffset?: number;

/**
* @public
* <p>The number of hours the association can run before it is canceled. Duration applies to
* associations that are currently running, and any pending and in progress commands on all targets.
* If a target was taken offline for the association to run, it is made available again immediately,
* without a reboot. </p>
* <p>The <code>Duration</code> parameter applies only when both these conditions are true:</p>
* <ul>
* <li>
* <p>The association for which you specify a duration is cancelable according to the parameters
* of the SSM command document or Automation runbook associated with this execution. </p>
* </li>
* <li>
* <p>The command specifies the <code>
* <a href="https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_CreateAssociation.html#systemsmanager-CreateAssociation-request-ApplyOnlyAtCronInterval">ApplyOnlyAtCronInterval</a>
* </code> parameter, which means that the association doesn't
* run immediately after it is created, but only according to the specified schedule.</p>
* </li>
* </ul>
*/
Duration?: number;

/**
* @public
* <p>A key-value mapping of document parameters to target resources. Both Targets and TargetMaps
Expand Down Expand Up @@ -1613,6 +1635,14 @@ export interface AssociationDescription {
*/
ScheduleOffset?: number;

/**
* @public
* <p>The number of hours that an association can run on specified targets. After the resulting
* cutoff time passes, associations that are currently running are cancelled, and no pending
* executions are started on remaining targets.</p>
*/
Duration?: number;

/**
* @public
* <p>A key-value mapping of document parameters to target resources. Both Targets and TargetMaps
Expand Down Expand Up @@ -1993,6 +2023,28 @@ export interface CreateAssociationBatchRequestEntry {
*/
ScheduleOffset?: number;

/**
* @public
* <p>The number of hours the association can run before it is canceled. Duration applies to
* associations that are currently running, and any pending and in progress commands on all targets.
* If a target was taken offline for the association to run, it is made available again immediately,
* without a reboot. </p>
* <p>The <code>Duration</code> parameter applies only when both these conditions are true:</p>
* <ul>
* <li>
* <p>The association for which you specify a duration is cancelable according to the parameters
* of the SSM command document or Automation runbook associated with this execution. </p>
* </li>
* <li>
* <p>The command specifies the <code>
* <a href="https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_CreateAssociationBatchRequestEntry.html#systemsmanager-Type-CreateAssociationBatchRequestEntry-ApplyOnlyAtCronInterval">ApplyOnlyAtCronInterval</a>
* </code> parameter, which means that the association doesn't
* run immediately after it is created, but only according to the specified schedule.</p>
* </li>
* </ul>
*/
Duration?: number;

/**
* @public
* <p>A key-value mapping of document parameters to target resources. Both Targets and TargetMaps
Expand Down Expand Up @@ -2217,7 +2269,7 @@ export interface DocumentRequires {
/**
* @public
* <p>An optional field specifying the version of the artifact associated with the document. For
* example, "Release 12, Update 6". This value is unique across all versions of a document, and
* example, 12.6. This value is unique across all versions of a document, and
* can't be changed.</p>
*/
VersionName?: string;
Expand Down Expand Up @@ -6810,7 +6862,7 @@ export interface DescribeDocumentRequest {
/**
* @public
* <p>An optional field specifying the version of the artifact associated with the document. For
* example, "Release 12, Update 6". This value is unique across all versions of a document, and
* example, 12.6. This value is unique across all versions of a document, and
* can't be changed.</p>
*/
VersionName?: string;
Expand Down Expand Up @@ -7794,6 +7846,10 @@ export interface PatchComplianceData {
* @public
* <p>The IDs of one or more Common Vulnerabilities and Exposure (CVE) issues that are resolved by
* the patch.</p>
* <note>
* <p>Currently, CVE ID values are reported only for patches with a status of
* <code>Missing</code> or <code>Failed</code>.</p>
* </note>
*/
CVEIds?: string;
}
Expand Down
35 changes: 25 additions & 10 deletions clients/client-ssm/src/models/models_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,8 @@ export interface ParameterMetadata {

/**
* @public
* <p>The ID of the query key used for this parameter.</p>
* <p>The alias of the Key Management Service (KMS) key used to encrypt the
* parameter. Applies to <code>SecureString</code> parameters only.</p>
*/
KeyId?: string;

Expand Down Expand Up @@ -2262,8 +2263,7 @@ export interface GetConnectionStatusResponse {

/**
* @public
* <p>The status of the connection to the managed node. For example, 'Connected' or 'Not
* Connected'.</p>
* <p>The status of the connection to the managed node.</p>
*/
Status?: ConnectionStatus;
}
Expand Down Expand Up @@ -2461,7 +2461,7 @@ export interface GetDocumentRequest {
/**
* @public
* <p>An optional field specifying the version of the artifact associated with the document. For
* example, "Release 12, Update 6". This value is unique across all versions of a document and can't
* example, 12.6. This value is unique across all versions of a document and can't
* be changed.</p>
*/
VersionName?: string;
Expand Down Expand Up @@ -2554,8 +2554,7 @@ export interface GetDocumentResult {

/**
* @public
* <p>The version of the artifact associated with the document. For example, "Release 12, Update
* 6". This value is unique across all versions of a document, and can't be changed.</p>
* <p>The version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.</p>
*/
VersionName?: string;

Expand Down Expand Up @@ -4434,7 +4433,8 @@ export interface ParameterHistory {

/**
* @public
* <p>The ID of the query key used for this parameter.</p>
* <p>The alias of the Key Management Service (KMS) key used to encrypt the
* parameter. Applies to <code>SecureString</code> parameters only</p>
*/
KeyId?: string;

Expand Down Expand Up @@ -5254,6 +5254,14 @@ export interface Association {
*/
ScheduleOffset?: number;

/**
* @public
* <p>The number of hours that an association can run on specified targets. After the resulting
* cutoff time passes, associations that are currently running are cancelled, and no pending
* executions are started on remaining targets.</p>
*/
Duration?: number;

/**
* @public
* <p>A key-value mapping of document parameters to target resources. Both Targets and TargetMaps
Expand Down Expand Up @@ -5453,6 +5461,14 @@ export interface AssociationVersionInfo {
*/
ScheduleOffset?: number;

/**
* @public
* <p>The number of hours that an association can run on specified targets. After the resulting
* cutoff time passes, associations that are currently running are cancelled, and no pending
* executions are started on remaining targets.</p>
*/
Duration?: number;

/**
* @public
* <p>A key-value mapping of document parameters to target resources. Both Targets and TargetMaps
Expand Down Expand Up @@ -7225,7 +7241,7 @@ export interface DocumentIdentifier {
/**
* @public
* <p>An optional field specifying the version of the artifact associated with the document. For
* example, "Release 12, Update 6". This value is unique across all versions of a document, and
* example, 12.6. This value is unique across all versions of a document, and
* can't be changed.</p>
*/
VersionName?: string;
Expand Down Expand Up @@ -7364,8 +7380,7 @@ export interface DocumentVersionInfo {

/**
* @public
* <p>The version of the artifact associated with the document. For example, "Release 12, Update
* 6". This value is unique across all versions of a document, and can't be changed.</p>
* <p>The version of the artifact associated with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.</p>
*/
VersionName?: string;

Expand Down
24 changes: 23 additions & 1 deletion clients/client-ssm/src/models/models_2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,28 @@ export interface UpdateAssociationRequest {
*/
ScheduleOffset?: number;

/**
* @public
* <p>The number of hours the association can run before it is canceled. Duration applies to
* associations that are currently running, and any pending and in progress commands on all targets.
* If a target was taken offline for the association to run, it is made available again immediately,
* without a reboot. </p>
* <p>The <code>Duration</code> parameter applies only when both these conditions are true:</p>
* <ul>
* <li>
* <p>The association for which you specify a duration is cancelable according to the parameters
* of the SSM command document or Automation runbook associated with this execution. </p>
* </li>
* <li>
* <p>The command specifies the <code>
* <a href="https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_UpdateAssociation.html#systemsmanager-UpdateAssociation-request-ApplyOnlyAtCronInterval">ApplyOnlyAtCronInterval</a>
* </code> parameter, which means that the association doesn't
* run immediately after it is updated, but only according to the specified schedule.</p>
* </li>
* </ul>
*/
Duration?: number;

/**
* @public
* <p>A key-value mapping of document parameters to target resources. Both Targets and TargetMaps
Expand Down Expand Up @@ -517,7 +539,7 @@ export interface UpdateDocumentRequest {
/**
* @public
* <p>An optional field specifying the version of the artifact you are updating with the document.
* For example, "Release 12, Update 6". This value is unique across all versions of a document, and
* For example, 12.6. This value is unique across all versions of a document, and
* can't be changed.</p>
*/
VersionName?: string;
Expand Down
3 changes: 3 additions & 0 deletions clients/client-ssm/src/protocols/Aws_json1_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13198,6 +13198,7 @@ const de_Association = (output: any, context: __SerdeContext): Association => {
AssociationName: __expectString,
AssociationVersion: __expectString,
DocumentVersion: __expectString,
Duration: __expectInt32,
InstanceId: __expectString,
LastExecutionDate: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
Name: __expectString,
Expand Down Expand Up @@ -13226,6 +13227,7 @@ const de_AssociationDescription = (output: any, context: __SerdeContext): Associ
ComplianceSeverity: __expectString,
Date: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
DocumentVersion: __expectString,
Duration: __expectInt32,
InstanceId: __expectString,
LastExecutionDate: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
LastSuccessfulExecutionDate: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
Expand Down Expand Up @@ -13365,6 +13367,7 @@ const de_AssociationVersionInfo = (output: any, context: __SerdeContext): Associ
ComplianceSeverity: __expectString,
CreatedDate: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
DocumentVersion: __expectString,
Duration: __expectInt32,
MaxConcurrency: __expectString,
MaxErrors: __expectString,
Name: __expectString,
Expand Down

0 comments on commit c587e27

Please sign in to comment.