Skip to content

Commit ccd5d97

Browse files
author
awstools
committed
feat(client-config-service): AWS Config now supports ConformancePackTemplate documents in SSM Docs for the deployment and update of conformance packs.
1 parent 51a4ff5 commit ccd5d97

File tree

6 files changed

+186
-68
lines changed

6 files changed

+186
-68
lines changed

clients/client-config-service/src/ConfigService.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3218,8 +3218,7 @@ export class ConfigService extends ConfigServiceClient {
32183218
* <p>This API creates a service-linked role <code>AWSServiceRoleForConfigConforms</code> in your account.
32193219
* The service-linked role is created only when the role does not exist in your account. </p>
32203220
* <note>
3221-
* <p>You must specify either the <code>TemplateS3Uri</code> or the <code>TemplateBody</code> parameter, but not both.
3222-
* If you provide both Config uses the <code>TemplateS3Uri</code> parameter and ignores the <code>TemplateBody</code> parameter.</p>
3221+
* <p>You must specify one and only one of the<code>TemplateS3Uri</code>, <code>TemplateBody</code> or <code>TemplateSSMDocumentDetails</code> parameters.</p>
32233222
* </note>
32243223
*/
32253224
public putConformancePack(

clients/client-config-service/src/commands/PutConformancePackCommand.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,12 @@ import {
1313
} from "@aws-sdk/types";
1414

1515
import { ConfigServiceClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ConfigServiceClient";
16-
import { PutConformancePackRequest, PutConformancePackRequestFilterSensitiveLog } from "../models/models_0";
17-
import { PutConformancePackResponse, PutConformancePackResponseFilterSensitiveLog } from "../models/models_1";
16+
import {
17+
PutConformancePackRequest,
18+
PutConformancePackRequestFilterSensitiveLog,
19+
PutConformancePackResponse,
20+
PutConformancePackResponseFilterSensitiveLog,
21+
} from "../models/models_1";
1822
import {
1923
deserializeAws_json1_1PutConformancePackCommand,
2024
serializeAws_json1_1PutConformancePackCommand,
@@ -32,8 +36,7 @@ export interface PutConformancePackCommandOutput extends PutConformancePackRespo
3236
* <p>This API creates a service-linked role <code>AWSServiceRoleForConfigConforms</code> in your account.
3337
* The service-linked role is created only when the role does not exist in your account. </p>
3438
* <note>
35-
* <p>You must specify either the <code>TemplateS3Uri</code> or the <code>TemplateBody</code> parameter, but not both.
36-
* If you provide both Config uses the <code>TemplateS3Uri</code> parameter and ignores the <code>TemplateBody</code> parameter.</p>
39+
* <p>You must specify one and only one of the<code>TemplateS3Uri</code>, <code>TemplateBody</code> or <code>TemplateSSMDocumentDetails</code> parameters.</p>
3740
* </note>
3841
* @example
3942
* Use a bare-bones client and the command you need to make an API call.

clients/client-config-service/src/models/models_0.ts

Lines changed: 37 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -2094,6 +2094,28 @@ export interface ConformancePackInputParameter {
20942094
ParameterValue: string | undefined;
20952095
}
20962096

2097+
/**
2098+
* <p>This API allows you to create a conformance pack template with an Amazon Web Services Systems Manager document (SSM document).
2099+
* To deploy a conformance pack using an SSM document, you first create an SSM document with conformance pack content, and then provide the <code>DocumentName</code> (and optionally <code>DocumentVersion</code>) in the <a href="https://docs.aws.amazon.com/config/latest/APIReference/API_PutConformancePack.html">PutConformancePack API</a>.</p>
2100+
*
2101+
* <p>The <code>TemplateSSMDocumentDetails</code> object contains the name of the SSM document and the version of the SSM document.</p>
2102+
*/
2103+
export interface TemplateSSMDocumentDetails {
2104+
/**
2105+
* <p>The name or Amazon Resource Name (ARN) of the SSM document to use to create a conformance pack.
2106+
* If you use the Document Name, Config checks only your account and region for the SSM document. If you want to use an SSM document from another region or account, you must provide the ARN.</p>
2107+
*/
2108+
DocumentName: string | undefined;
2109+
2110+
/**
2111+
* <p>The version of the SSM document to use to create a conformance pack. By default, Config uses the latest version.</p>
2112+
* <note>
2113+
* <p>This field is optional.</p>
2114+
* </note>
2115+
*/
2116+
DocumentVersion?: string;
2117+
}
2118+
20972119
/**
20982120
* <p>Returns details of a conformance pack. A conformance pack is a collection of Config rules and remediation actions that can be easily deployed in an account and a region.</p>
20992121
*/
@@ -2135,14 +2157,19 @@ export interface ConformancePackDetail {
21352157
ConformancePackInputParameters?: ConformancePackInputParameter[];
21362158

21372159
/**
2138-
* <p>Last time when conformation pack update was requested. </p>
2160+
* <p>The last time a conformation pack update was requested. </p>
21392161
*/
21402162
LastUpdateRequestedTime?: Date;
21412163

21422164
/**
2143-
* <p>Amazon Web Services service that created the conformance pack.</p>
2165+
* <p>The Amazon Web Services service that created the conformance pack.</p>
21442166
*/
21452167
CreatedBy?: string;
2168+
2169+
/**
2170+
* <p>An object that contains the name or Amazon Resource Name (ARN) of the Amazon Web Services Systems Manager document (SSM document) and the version of the SSM document that is used to create a conformance pack.</p>
2171+
*/
2172+
TemplateSSMDocumentDetails?: TemplateSSMDocumentDetails;
21462173
}
21472174

21482175
/**
@@ -2692,7 +2719,7 @@ export interface DeleteRemediationConfigurationResponse {}
26922719
* <p>To call IAM <code>GetRole</code> action or create a service-linked role.</p>
26932720
* </li>
26942721
* <li>
2695-
* <p>To read Amazon S3 bucket.</p>
2722+
* <p>To read Amazon S3 bucket or call SSM:GetDocument.</p>
26962723
* </li>
26972724
* </ul>
26982725
* </li>
@@ -6904,50 +6931,6 @@ export interface PutConfigurationRecorderRequest {
69046931
ConfigurationRecorder: ConfigurationRecorder | undefined;
69056932
}
69066933

6907-
export interface PutConformancePackRequest {
6908-
/**
6909-
* <p>Name of the conformance pack you want to create.</p>
6910-
*/
6911-
ConformancePackName: string | undefined;
6912-
6913-
/**
6914-
* <p>Location of file containing the template body (<code>s3://bucketname/prefix</code>). The uri must point to the conformance pack template (max size: 300 KB) that is located in an Amazon S3 bucket in the same region as the conformance pack. </p>
6915-
* <note>
6916-
* <p>You must have access to read Amazon S3 bucket.</p>
6917-
* </note>
6918-
*/
6919-
TemplateS3Uri?: string;
6920-
6921-
/**
6922-
* <p>A string containing full conformance pack template body. Structure containing the template body with a minimum length of 1 byte and a maximum length of 51,200 bytes.</p>
6923-
* <note>
6924-
* <p>You can only use a YAML template with two resource types: Config rule (<code>AWS::Config::ConfigRule</code>) and a remediation action (<code>AWS::Config::RemediationConfiguration</code>).</p>
6925-
* </note>
6926-
*/
6927-
TemplateBody?: string;
6928-
6929-
/**
6930-
* <p>The name of the Amazon S3 bucket where Config stores conformance pack templates.</p>
6931-
* <note>
6932-
* <p>This field is optional.</p>
6933-
* </note>
6934-
*/
6935-
DeliveryS3Bucket?: string;
6936-
6937-
/**
6938-
* <p>The prefix for the Amazon S3 bucket. </p>
6939-
* <note>
6940-
* <p>This field is optional.</p>
6941-
* </note>
6942-
*/
6943-
DeliveryS3KeyPrefix?: string;
6944-
6945-
/**
6946-
* <p>A list of <code>ConformancePackInputParameter</code> objects.</p>
6947-
*/
6948-
ConformancePackInputParameters?: ConformancePackInputParameter[];
6949-
}
6950-
69516934
/**
69526935
* @internal
69536936
*/
@@ -7314,6 +7297,13 @@ export const ConformancePackInputParameterFilterSensitiveLog = (obj: Conformance
73147297
...obj,
73157298
});
73167299

7300+
/**
7301+
* @internal
7302+
*/
7303+
export const TemplateSSMDocumentDetailsFilterSensitiveLog = (obj: TemplateSSMDocumentDetails): any => ({
7304+
...obj,
7305+
});
7306+
73177307
/**
73187308
* @internal
73197309
*/
@@ -8667,10 +8657,3 @@ export const PutConfigurationAggregatorResponseFilterSensitiveLog = (obj: PutCon
86678657
export const PutConfigurationRecorderRequestFilterSensitiveLog = (obj: PutConfigurationRecorderRequest): any => ({
86688658
...obj,
86698659
});
8670-
8671-
/**
8672-
* @internal
8673-
*/
8674-
export const PutConformancePackRequestFilterSensitiveLog = (obj: PutConformancePackRequest): any => ({
8675-
...obj,
8676-
});

clients/client-config-service/src/models/models_1.ts

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,58 @@ import {
1919
RetentionConfiguration,
2020
StoredQuery,
2121
Tag,
22+
TemplateSSMDocumentDetails,
2223
} from "./models_0";
2324

25+
export interface PutConformancePackRequest {
26+
/**
27+
* <p>The unique name of the conformance pack you want to deploy.</p>
28+
*/
29+
ConformancePackName: string | undefined;
30+
31+
/**
32+
* <p>The location of the file containing the template body (<code>s3://bucketname/prefix</code>). The uri must point to a conformance pack template (max size: 300 KB) that is located in an Amazon S3 bucket in the same region as the conformance pack. </p>
33+
* <note>
34+
* <p>You must have access to read Amazon S3 bucket.</p>
35+
* </note>
36+
*/
37+
TemplateS3Uri?: string;
38+
39+
/**
40+
* <p>A string containing the full conformance pack template body. The structure containing the template body has a minimum length of 1 byte and a maximum length of 51,200 bytes.</p>
41+
* <note>
42+
* <p>You can only use a YAML template with two resource types: Config rule (<code>AWS::Config::ConfigRule</code>) and remediation action (<code>AWS::Config::RemediationConfiguration</code>).</p>
43+
* </note>
44+
*/
45+
TemplateBody?: string;
46+
47+
/**
48+
* <p>The name of the Amazon S3 bucket where Config stores conformance pack templates.</p>
49+
* <note>
50+
* <p>This field is optional.</p>
51+
* </note>
52+
*/
53+
DeliveryS3Bucket?: string;
54+
55+
/**
56+
* <p>The prefix for the Amazon S3 bucket. </p>
57+
* <note>
58+
* <p>This field is optional.</p>
59+
* </note>
60+
*/
61+
DeliveryS3KeyPrefix?: string;
62+
63+
/**
64+
* <p>A list of <code>ConformancePackInputParameter</code> objects.</p>
65+
*/
66+
ConformancePackInputParameters?: ConformancePackInputParameter[];
67+
68+
/**
69+
* <p>An object of type <code>TemplateSSMDocumentDetails</code>, which contains the name or the Amazon Resource Name (ARN) of the Amazon Web Services Systems Manager document (SSM document) and the version of the SSM document that is used to create a conformance pack.</p>
70+
*/
71+
TemplateSSMDocumentDetails?: TemplateSSMDocumentDetails;
72+
}
73+
2474
export interface PutConformancePackResponse {
2575
/**
2676
* <p>ARN of the conformance pack.</p>
@@ -536,6 +586,13 @@ export interface UntagResourceRequest {
536586
TagKeys: string[] | undefined;
537587
}
538588

589+
/**
590+
* @internal
591+
*/
592+
export const PutConformancePackRequestFilterSensitiveLog = (obj: PutConformancePackRequest): any => ({
593+
...obj,
594+
});
595+
539596
/**
540597
* @internal
541598
*/

clients/client-config-service/src/protocols/Aws_json1_1.ts

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,6 @@ import {
584584
PutConfigurationAggregatorRequest,
585585
PutConfigurationAggregatorResponse,
586586
PutConfigurationRecorderRequest,
587-
PutConformancePackRequest,
588587
RecordingGroup,
589588
Relationship,
590589
RemediationConfiguration,
@@ -614,9 +613,11 @@ import {
614613
StoredQuery,
615614
StoredQueryMetadata,
616615
Tag,
616+
TemplateSSMDocumentDetails,
617617
ValidationException,
618618
} from "../models/models_0";
619619
import {
620+
PutConformancePackRequest,
620621
PutConformancePackResponse,
621622
PutDeliveryChannelRequest,
622623
PutEvaluationsRequest,
@@ -8008,6 +8009,12 @@ const serializeAws_json1_1PutConformancePackRequest = (
80088009
...(input.DeliveryS3KeyPrefix != null && { DeliveryS3KeyPrefix: input.DeliveryS3KeyPrefix }),
80098010
...(input.TemplateBody != null && { TemplateBody: input.TemplateBody }),
80108011
...(input.TemplateS3Uri != null && { TemplateS3Uri: input.TemplateS3Uri }),
8012+
...(input.TemplateSSMDocumentDetails != null && {
8013+
TemplateSSMDocumentDetails: serializeAws_json1_1TemplateSSMDocumentDetails(
8014+
input.TemplateSSMDocumentDetails,
8015+
context
8016+
),
8017+
}),
80118018
};
80128019
};
80138020

@@ -8539,6 +8546,16 @@ const serializeAws_json1_1TagsList = (input: Tag[], context: __SerdeContext): an
85398546
});
85408547
};
85418548

8549+
const serializeAws_json1_1TemplateSSMDocumentDetails = (
8550+
input: TemplateSSMDocumentDetails,
8551+
context: __SerdeContext
8552+
): any => {
8553+
return {
8554+
...(input.DocumentName != null && { DocumentName: input.DocumentName }),
8555+
...(input.DocumentVersion != null && { DocumentVersion: input.DocumentVersion }),
8556+
};
8557+
};
8558+
85428559
const serializeAws_json1_1UntagResourceRequest = (input: UntagResourceRequest, context: __SerdeContext): any => {
85438560
return {
85448561
...(input.ResourceArn != null && { ResourceArn: input.ResourceArn }),
@@ -9396,6 +9413,10 @@ const deserializeAws_json1_1ConformancePackDetail = (output: any, context: __Ser
93969413
output.LastUpdateRequestedTime != null
93979414
? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.LastUpdateRequestedTime)))
93989415
: undefined,
9416+
TemplateSSMDocumentDetails:
9417+
output.TemplateSSMDocumentDetails != null
9418+
? deserializeAws_json1_1TemplateSSMDocumentDetails(output.TemplateSSMDocumentDetails, context)
9419+
: undefined,
93999420
} as any;
94009421
};
94019422

@@ -11977,6 +11998,16 @@ const deserializeAws_json1_1Tags = (output: any, context: __SerdeContext): Recor
1197711998
}, {});
1197811999
};
1197912000

12001+
const deserializeAws_json1_1TemplateSSMDocumentDetails = (
12002+
output: any,
12003+
context: __SerdeContext
12004+
): TemplateSSMDocumentDetails => {
12005+
return {
12006+
DocumentName: __expectString(output.DocumentName),
12007+
DocumentVersion: __expectString(output.DocumentVersion),
12008+
} as any;
12009+
};
12010+
1198012011
const deserializeAws_json1_1TooManyTagsException = (output: any, context: __SerdeContext): TooManyTagsException => {
1198112012
return {
1198212013
message: __expectString(output.message),

0 commit comments

Comments
 (0)