Skip to content

Commit b540379

Browse files
Add integration with SSM Parameter Store to Image Builder.
1 parent efa7c0f commit b540379

File tree

14 files changed

+506
-15
lines changed

14 files changed

+506
-15
lines changed

generator/ServiceModels/imagebuilder/imagebuilder-2019-12-02.api.json

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2279,7 +2279,8 @@
22792279
"licenseConfigurationArns":{"shape":"LicenseConfigurationArnList"},
22802280
"launchTemplateConfigurations":{"shape":"LaunchTemplateConfigurationList"},
22812281
"s3ExportConfiguration":{"shape":"S3ExportConfiguration"},
2282-
"fastLaunchConfigurations":{"shape":"FastLaunchConfigurationList"}
2282+
"fastLaunchConfigurations":{"shape":"FastLaunchConfigurationList"},
2283+
"ssmParameterConfigurations":{"shape":"SsmParameterConfigurationList"}
22832284
}
22842285
},
22852286
"DistributionConfiguration":{
@@ -4596,6 +4597,32 @@
45964597
"pattern":"^arn:aws[^:]*:sns:[^:]+:[0-9]{12}:[a-zA-Z0-9-_]{1,256}$"
45974598
},
45984599
"SourceLayerHash":{"type":"string"},
4600+
"SsmParameterConfiguration":{
4601+
"type":"structure",
4602+
"required":["parameterName"],
4603+
"members":{
4604+
"amiAccountId":{"shape":"AccountId"},
4605+
"parameterName":{"shape":"SsmParameterName"},
4606+
"dataType":{"shape":"SsmParameterDataType"}
4607+
}
4608+
},
4609+
"SsmParameterConfigurationList":{
4610+
"type":"list",
4611+
"member":{"shape":"SsmParameterConfiguration"}
4612+
},
4613+
"SsmParameterDataType":{
4614+
"type":"string",
4615+
"enum":[
4616+
"text",
4617+
"aws:ec2:image"
4618+
]
4619+
},
4620+
"SsmParameterName":{
4621+
"type":"string",
4622+
"max":1011,
4623+
"min":1,
4624+
"pattern":"^[a-zA-Z0-9_.\\-\\/]+$"
4625+
},
45994626
"StartImagePipelineExecutionRequest":{
46004627
"type":"structure",
46014628
"required":[
@@ -4726,7 +4753,7 @@
47264753
"type":"string",
47274754
"max":100,
47284755
"min":3,
4729-
"pattern":"[a-zA-Z0-9]{2,}(?:\\/[a-zA-z0-9-_+]+)*"
4756+
"pattern":"[a-zA-Z0-9]{2,}(?:\\/[a-zA-Z0-9-_+]+)*"
47304757
},
47314758
"UntagResourceRequest":{
47324759
"type":"structure",

generator/ServiceModels/imagebuilder/imagebuilder-2019-12-02.docs.json

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@
9090
"refs": {
9191
"AccountList$member": null,
9292
"FastLaunchConfiguration$accountId": "<p>The owner account ID for the fast-launch enabled Windows AMI.</p>",
93-
"LaunchTemplateConfiguration$accountId": "<p>The account ID that this configuration applies to.</p>"
93+
"LaunchTemplateConfiguration$accountId": "<p>The account ID that this configuration applies to.</p>",
94+
"SsmParameterConfiguration$amiAccountId": "<p>Specify the account that will own the Parameter in a given Region. During distribution, this account must be specified in distribution settings as a target account for the Region.</p>"
9495
}
9596
},
9697
"AccountList": {
@@ -2168,7 +2169,7 @@
21682169
"ContainerRecipe$description": "<p>The description of the container recipe.</p>",
21692170
"ContainerRecipe$owner": "<p>The owner of the container recipe.</p>",
21702171
"ContainerRecipe$kmsKeyId": "<p>Identifies which KMS key is used to encrypt the container image for distribution to the target Region.</p>",
2171-
"ContainerRecipe$parentImage": "<p>The base image for the container recipe.</p>",
2172+
"ContainerRecipe$parentImage": "<p>The base image for customizations specified in the container recipe. This can contain an Image Builder image resource ARN or a container image URI, for example <code>amazonlinux:latest</code>.</p>",
21722173
"ContainerRecipe$workingDirectory": "<p>The working directory for use during build and test workflows.</p>",
21732174
"ContainerRecipeSummary$owner": "<p>The owner of the container recipe.</p>",
21742175
"ContainerRecipeSummary$parentImage": "<p>The base image for the container recipe.</p>",
@@ -2244,7 +2245,7 @@
22442245
"ImagePipeline$description": "<p>The description of the image pipeline.</p>",
22452246
"ImageRecipe$description": "<p>The description of the image recipe.</p>",
22462247
"ImageRecipe$owner": "<p>The owner of the image recipe.</p>",
2247-
"ImageRecipe$parentImage": "<p>The base image of the image recipe.</p>",
2248+
"ImageRecipe$parentImage": "<p>The base image for customizations specified in the image recipe. You can specify the parent image using one of the following options:</p> <ul> <li> <p>AMI ID</p> </li> <li> <p>Image Builder image Amazon Resource Name (ARN)</p> </li> <li> <p>Amazon Web Services Systems Manager (SSM) Parameter Store Parameter, prefixed by <code>ssm:</code>, followed by the parameter name or ARN.</p> </li> <li> <p>Amazon Web Services Marketplace product ID</p> </li> </ul>",
22482249
"ImageRecipe$workingDirectory": "<p>The working directory to be used during build and test workflows.</p>",
22492250
"ImageRecipeSummary$owner": "<p>The owner of the image recipe.</p>",
22502251
"ImageRecipeSummary$parentImage": "<p>The base image of the image recipe.</p>",
@@ -2277,7 +2278,7 @@
22772278
"InfrastructureConfigurationSummary$description": "<p>The description of the infrastructure configuration.</p>",
22782279
"InstanceBlockDeviceMapping$deviceName": "<p>The device to which these mappings apply.</p>",
22792280
"InstanceBlockDeviceMapping$virtualName": "<p>Use to manage instance ephemeral devices.</p>",
2280-
"InstanceConfiguration$image": "<p>The AMI ID to use as the base image for a container build and test instance. If not specified, Image Builder will use the appropriate ECS-optimized AMI as a base image.</p>",
2281+
"InstanceConfiguration$image": "<p>The base image for a container build and test instance. This can contain an AMI ID or it can specify an Amazon Web Services Systems Manager (SSM) Parameter Store Parameter, prefixed by <code>ssm:</code>, followed by the parameter name or ARN.</p> <p>If not specified, Image Builder uses the appropriate ECS-optimized AMI as a base image.</p>",
22812282
"LifecycleExecutionResource$accountId": "<p>The account that owns the impacted resource.</p>",
22822283
"LifecycleExecutionResource$resourceId": "<p>Identifies the impacted resource. The resource ID depends on the type of resource, as follows.</p> <ul> <li> <p>Image Builder image resources: Amazon Resource Name (ARN)</p> </li> <li> <p>Distributed AMIs: AMI ID</p> </li> <li> <p>Container images distributed to an ECR repository: image URI or SHA Digest</p> </li> </ul>",
22832284
"LifecycleExecutionResource$region": "<p>The Amazon Web Services Region where the lifecycle execution resource is stored.</p>",
@@ -2886,6 +2887,30 @@
28862887
"VulnerablePackage$sourceLayerHash": "<p>The source layer hash of the vulnerable package.</p>"
28872888
}
28882889
},
2890+
"SsmParameterConfiguration": {
2891+
"base": "<p>Configuration for a single Parameter in the Amazon Web Services Systems Manager (SSM) Parameter Store in a given Region.</p>",
2892+
"refs": {
2893+
"SsmParameterConfigurationList$member": null
2894+
}
2895+
},
2896+
"SsmParameterConfigurationList": {
2897+
"base": null,
2898+
"refs": {
2899+
"Distribution$ssmParameterConfigurations": "<p>Contains settings to update Amazon Web Services Systems Manager (SSM) Parameter Store Parameters with output AMI IDs from the build by target Region.</p>"
2900+
}
2901+
},
2902+
"SsmParameterDataType": {
2903+
"base": null,
2904+
"refs": {
2905+
"SsmParameterConfiguration$dataType": "<p>The data type specifies what type of value the Parameter contains. We recommend that you use data type <code>aws:ec2:image</code>.</p>"
2906+
}
2907+
},
2908+
"SsmParameterName": {
2909+
"base": null,
2910+
"refs": {
2911+
"SsmParameterConfiguration$parameterName": "<p>This is the name of the Parameter in the target Region or account. The image distribution creates the Parameter if it doesn't already exist. Otherwise, it updates the parameter.</p>"
2912+
}
2913+
},
28892914
"StartImagePipelineExecutionRequest": {
28902915
"base": null,
28912916
"refs": {

generator/ServiceModels/imagebuilder/imagebuilder-2019-12-02.normal.json

Lines changed: 44 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2099,7 +2099,7 @@
20992099
},
21002100
"parentImage":{
21012101
"shape":"NonEmptyString",
2102-
"documentation":"<p>The base image for the container recipe.</p>"
2102+
"documentation":"<p>The base image for customizations specified in the container recipe. This can contain an Image Builder image resource ARN or a container image URI, for example <code>amazonlinux:latest</code>.</p>"
21032103
},
21042104
"dateCreated":{
21052105
"shape":"DateTime",
@@ -3168,6 +3168,10 @@
31683168
"fastLaunchConfigurations":{
31693169
"shape":"FastLaunchConfigurationList",
31703170
"documentation":"<p>The Windows faster-launching configurations to use for AMI distribution.</p>"
3171+
},
3172+
"ssmParameterConfigurations":{
3173+
"shape":"SsmParameterConfigurationList",
3174+
"documentation":"<p>Contains settings to update Amazon Web Services Systems Manager (SSM) Parameter Store Parameters with output AMI IDs from the build by target Region.</p>"
31713175
}
31723176
},
31733177
"documentation":"<p>Defines the settings for a specific Region.</p>"
@@ -4306,7 +4310,7 @@
43064310
},
43074311
"parentImage":{
43084312
"shape":"NonEmptyString",
4309-
"documentation":"<p>The base image of the image recipe.</p>"
4313+
"documentation":"<p>The base image for customizations specified in the image recipe. You can specify the parent image using one of the following options:</p> <ul> <li> <p>AMI ID</p> </li> <li> <p>Image Builder image Amazon Resource Name (ARN)</p> </li> <li> <p>Amazon Web Services Systems Manager (SSM) Parameter Store Parameter, prefixed by <code>ssm:</code>, followed by the parameter name or ARN.</p> </li> <li> <p>Amazon Web Services Marketplace product ID</p> </li> </ul>"
43104314
},
43114315
"blockDeviceMappings":{
43124316
"shape":"InstanceBlockDeviceMappings",
@@ -5122,7 +5126,7 @@
51225126
"members":{
51235127
"image":{
51245128
"shape":"NonEmptyString",
5125-
"documentation":"<p>The AMI ID to use as the base image for a container build and test instance. If not specified, Image Builder will use the appropriate ECS-optimized AMI as a base image.</p>"
5129+
"documentation":"<p>The base image for a container build and test instance. This can contain an AMI ID or it can specify an Amazon Web Services Systems Manager (SSM) Parameter Store Parameter, prefixed by <code>ssm:</code>, followed by the parameter name or ARN.</p> <p>If not specified, Image Builder uses the appropriate ECS-optimized AMI as a base image.</p>"
51265130
},
51275131
"blockDeviceMappings":{
51285132
"shape":"InstanceBlockDeviceMappings",
@@ -7270,6 +7274,42 @@
72707274
"pattern":"^arn:aws[^:]*:sns:[^:]+:[0-9]{12}:[a-zA-Z0-9-_]{1,256}$"
72717275
},
72727276
"SourceLayerHash":{"type":"string"},
7277+
"SsmParameterConfiguration":{
7278+
"type":"structure",
7279+
"required":["parameterName"],
7280+
"members":{
7281+
"amiAccountId":{
7282+
"shape":"AccountId",
7283+
"documentation":"<p>Specify the account that will own the Parameter in a given Region. During distribution, this account must be specified in distribution settings as a target account for the Region.</p>"
7284+
},
7285+
"parameterName":{
7286+
"shape":"SsmParameterName",
7287+
"documentation":"<p>This is the name of the Parameter in the target Region or account. The image distribution creates the Parameter if it doesn't already exist. Otherwise, it updates the parameter.</p>"
7288+
},
7289+
"dataType":{
7290+
"shape":"SsmParameterDataType",
7291+
"documentation":"<p>The data type specifies what type of value the Parameter contains. We recommend that you use data type <code>aws:ec2:image</code>.</p>"
7292+
}
7293+
},
7294+
"documentation":"<p>Configuration for a single Parameter in the Amazon Web Services Systems Manager (SSM) Parameter Store in a given Region.</p>"
7295+
},
7296+
"SsmParameterConfigurationList":{
7297+
"type":"list",
7298+
"member":{"shape":"SsmParameterConfiguration"}
7299+
},
7300+
"SsmParameterDataType":{
7301+
"type":"string",
7302+
"enum":[
7303+
"text",
7304+
"aws:ec2:image"
7305+
]
7306+
},
7307+
"SsmParameterName":{
7308+
"type":"string",
7309+
"max":1011,
7310+
"min":1,
7311+
"pattern":"^[a-zA-Z0-9_.\\-\\/]+$"
7312+
},
72737313
"StartImagePipelineExecutionRequest":{
72747314
"type":"structure",
72757315
"required":[
@@ -7453,7 +7493,7 @@
74537493
"type":"string",
74547494
"max":100,
74557495
"min":3,
7456-
"pattern":"[a-zA-Z0-9]{2,}(?:\\/[a-zA-z0-9-_+]+)*"
7496+
"pattern":"[a-zA-Z0-9]{2,}(?:\\/[a-zA-Z0-9-_+]+)*"
74577497
},
74587498
"UntagResourceRequest":{
74597499
"type":"structure",

sdk/code-analysis/ServiceAnalysis/Imagebuilder/Generated/PropertyValueRules.xml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2575,7 +2575,17 @@
25752575
<property>Amazon.Imagebuilder.Model.Schedule.Timezone</property>
25762576
<min>3</min>
25772577
<max>100</max>
2578-
<pattern>[a-zA-Z0-9]{2,}(?:\/[a-zA-z0-9-_+]+)*</pattern>
2578+
<pattern>[a-zA-Z0-9]{2,}(?:\/[a-zA-Z0-9-_+]+)*</pattern>
2579+
</property-value-rule>
2580+
<property-value-rule>
2581+
<property>Amazon.Imagebuilder.Model.SsmParameterConfiguration.AmiAccountId</property>
2582+
<pattern>^[0-9]{12}$</pattern>
2583+
</property-value-rule>
2584+
<property-value-rule>
2585+
<property>Amazon.Imagebuilder.Model.SsmParameterConfiguration.ParameterName</property>
2586+
<min>1</min>
2587+
<max>1011</max>
2588+
<pattern>^[a-zA-Z0-9_.\-\/]+$</pattern>
25792589
</property-value-rule>
25802590
<property-value-rule>
25812591
<property>Amazon.Imagebuilder.Model.TargetContainerRepository.RepositoryName</property>

sdk/src/Services/Imagebuilder/Generated/Model/ContainerRecipe.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,8 @@ internal bool IsSetOwner()
285285
/// <summary>
286286
/// Gets and sets the property ParentImage.
287287
/// <para>
288-
/// The base image for the container recipe.
288+
/// The base image for customizations specified in the container recipe. This can contain
289+
/// an Image Builder image resource ARN or a container image URI, for example <c>amazonlinux:latest</c>.
289290
/// </para>
290291
/// </summary>
291292
[AWSProperty(Min=1, Max=1024)]

sdk/src/Services/Imagebuilder/Generated/Model/Distribution.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public partial class Distribution
4141
private List<string> _licenseConfigurationArns = AWSConfigs.InitializeCollections ? new List<string>() : null;
4242
private string _region;
4343
private S3ExportConfiguration _s3ExportConfiguration;
44+
private List<SsmParameterConfiguration> _ssmParameterConfigurations = AWSConfigs.InitializeCollections ? new List<SsmParameterConfiguration>() : null;
4445

4546
/// <summary>
4647
/// Gets and sets the property AmiDistributionConfiguration.
@@ -175,5 +176,24 @@ internal bool IsSetS3ExportConfiguration()
175176
return this._s3ExportConfiguration != null;
176177
}
177178

179+
/// <summary>
180+
/// Gets and sets the property SsmParameterConfigurations.
181+
/// <para>
182+
/// Contains settings to update Amazon Web Services Systems Manager (SSM) Parameter Store
183+
/// Parameters with output AMI IDs from the build by target Region.
184+
/// </para>
185+
/// </summary>
186+
public List<SsmParameterConfiguration> SsmParameterConfigurations
187+
{
188+
get { return this._ssmParameterConfigurations; }
189+
set { this._ssmParameterConfigurations = value; }
190+
}
191+
192+
// Check to see if SsmParameterConfigurations property is set
193+
internal bool IsSetSsmParameterConfigurations()
194+
{
195+
return this._ssmParameterConfigurations != null && (this._ssmParameterConfigurations.Count > 0 || !AWSConfigs.InitializeCollections);
196+
}
197+
178198
}
179199
}

sdk/src/Services/Imagebuilder/Generated/Model/ImageRecipe.cs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,27 @@ internal bool IsSetOwner()
204204
/// <summary>
205205
/// Gets and sets the property ParentImage.
206206
/// <para>
207-
/// The base image of the image recipe.
207+
/// The base image for customizations specified in the image recipe. You can specify the
208+
/// parent image using one of the following options:
208209
/// </para>
210+
/// <ul> <li>
211+
/// <para>
212+
/// AMI ID
213+
/// </para>
214+
/// </li> <li>
215+
/// <para>
216+
/// Image Builder image Amazon Resource Name (ARN)
217+
/// </para>
218+
/// </li> <li>
219+
/// <para>
220+
/// Amazon Web Services Systems Manager (SSM) Parameter Store Parameter, prefixed by <c>ssm:</c>,
221+
/// followed by the parameter name or ARN.
222+
/// </para>
223+
/// </li> <li>
224+
/// <para>
225+
/// Amazon Web Services Marketplace product ID
226+
/// </para>
227+
/// </li> </ul>
209228
/// </summary>
210229
[AWSProperty(Min=1, Max=1024)]
211230
public string ParentImage

sdk/src/Services/Imagebuilder/Generated/Model/InstanceConfiguration.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,13 @@ internal bool IsSetBlockDeviceMappings()
6060
/// <summary>
6161
/// Gets and sets the property Image.
6262
/// <para>
63-
/// The AMI ID to use as the base image for a container build and test instance. If not
64-
/// specified, Image Builder will use the appropriate ECS-optimized AMI as a base image.
63+
/// The base image for a container build and test instance. This can contain an AMI ID
64+
/// or it can specify an Amazon Web Services Systems Manager (SSM) Parameter Store Parameter,
65+
/// prefixed by <c>ssm:</c>, followed by the parameter name or ARN.
66+
/// </para>
67+
///
68+
/// <para>
69+
/// If not specified, Image Builder uses the appropriate ECS-optimized AMI as a base image.
6570
/// </para>
6671
/// </summary>
6772
[AWSProperty(Min=1, Max=1024)]

sdk/src/Services/Imagebuilder/Generated/Model/Internal/MarshallTransformations/DistributionMarshaller.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,22 @@ public void Marshall(Distribution requestObject, JsonMarshallerContext context)
128128
context.Writer.WriteEndObject();
129129
}
130130

131+
if(requestObject.IsSetSsmParameterConfigurations())
132+
{
133+
context.Writer.WritePropertyName("ssmParameterConfigurations");
134+
context.Writer.WriteStartArray();
135+
foreach(var requestObjectSsmParameterConfigurationsListValue in requestObject.SsmParameterConfigurations)
136+
{
137+
context.Writer.WriteStartObject();
138+
139+
var marshaller = SsmParameterConfigurationMarshaller.Instance;
140+
marshaller.Marshall(requestObjectSsmParameterConfigurationsListValue, context);
141+
142+
context.Writer.WriteEndObject();
143+
}
144+
context.Writer.WriteEndArray();
145+
}
146+
131147
}
132148

133149
/// <summary>

sdk/src/Services/Imagebuilder/Generated/Model/Internal/MarshallTransformations/DistributionUnmarshaller.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@ public Distribution Unmarshall(JsonUnmarshallerContext context, ref StreamingUtf
9898
unmarshalledObject.S3ExportConfiguration = unmarshaller.Unmarshall(context, ref reader);
9999
continue;
100100
}
101+
if (context.TestExpression("ssmParameterConfigurations", targetDepth))
102+
{
103+
var unmarshaller = new JsonListUnmarshaller<SsmParameterConfiguration, SsmParameterConfigurationUnmarshaller>(SsmParameterConfigurationUnmarshaller.Instance);
104+
unmarshalledObject.SsmParameterConfigurations = unmarshaller.Unmarshall(context, ref reader);
105+
continue;
106+
}
101107
}
102108
return unmarshalledObject;
103109
}

0 commit comments

Comments
 (0)