Skip to content

Commit 95b25b4

Browse files
Add support for Image Tag Mutability Exception feature, allowing repositories to define wildcard-based patterns that override the default image tag mutability settings.
1 parent 16fb8be commit 95b25b4

22 files changed

+700
-4
lines changed

generator/ServiceModels/ecr/ecr-2015-09-21.api.json

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -992,6 +992,7 @@
992992
"encryptionConfiguration":{"shape":"EncryptionConfigurationForRepositoryCreationTemplate"},
993993
"resourceTags":{"shape":"TagList"},
994994
"imageTagMutability":{"shape":"ImageTagMutability"},
995+
"imageTagMutabilityExclusionFilters":{"shape":"ImageTagMutabilityExclusionFilters"},
995996
"repositoryPolicy":{"shape":"RepositoryPolicyText"},
996997
"lifecyclePolicy":{"shape":"LifecyclePolicyTextForRepositoryCreationTemplate"},
997998
"appliedFor":{"shape":"RCTAppliedForList"},
@@ -1013,6 +1014,7 @@
10131014
"repositoryName":{"shape":"RepositoryName"},
10141015
"tags":{"shape":"TagList"},
10151016
"imageTagMutability":{"shape":"ImageTagMutability"},
1017+
"imageTagMutabilityExclusionFilters":{"shape":"ImageTagMutabilityExclusionFilters"},
10161018
"imageScanningConfiguration":{"shape":"ImageScanningConfiguration"},
10171019
"encryptionConfiguration":{"shape":"EncryptionConfiguration"}
10181020
}
@@ -1699,9 +1701,38 @@
16991701
"type":"string",
17001702
"enum":[
17011703
"MUTABLE",
1702-
"IMMUTABLE"
1704+
"IMMUTABLE",
1705+
"IMMUTABLE_WITH_EXCLUSION",
1706+
"MUTABLE_WITH_EXCLUSION"
17031707
]
17041708
},
1709+
"ImageTagMutabilityExclusionFilter":{
1710+
"type":"structure",
1711+
"required":[
1712+
"filterType",
1713+
"filter"
1714+
],
1715+
"members":{
1716+
"filterType":{"shape":"ImageTagMutabilityExclusionFilterType"},
1717+
"filter":{"shape":"ImageTagMutabilityExclusionFilterValue"}
1718+
}
1719+
},
1720+
"ImageTagMutabilityExclusionFilterType":{
1721+
"type":"string",
1722+
"enum":["WILDCARD"]
1723+
},
1724+
"ImageTagMutabilityExclusionFilterValue":{
1725+
"type":"string",
1726+
"max":128,
1727+
"min":1,
1728+
"pattern":"^[0-9a-zA-Z._*-]{1,128}$"
1729+
},
1730+
"ImageTagMutabilityExclusionFilters":{
1731+
"type":"list",
1732+
"member":{"shape":"ImageTagMutabilityExclusionFilter"},
1733+
"max":5,
1734+
"min":1
1735+
},
17051736
"ImageTagsList":{
17061737
"type":"list",
17071738
"member":{"shape":"ImageTag"}
@@ -2147,15 +2178,17 @@
21472178
"members":{
21482179
"registryId":{"shape":"RegistryId"},
21492180
"repositoryName":{"shape":"RepositoryName"},
2150-
"imageTagMutability":{"shape":"ImageTagMutability"}
2181+
"imageTagMutability":{"shape":"ImageTagMutability"},
2182+
"imageTagMutabilityExclusionFilters":{"shape":"ImageTagMutabilityExclusionFilters"}
21512183
}
21522184
},
21532185
"PutImageTagMutabilityResponse":{
21542186
"type":"structure",
21552187
"members":{
21562188
"registryId":{"shape":"RegistryId"},
21572189
"repositoryName":{"shape":"RepositoryName"},
2158-
"imageTagMutability":{"shape":"ImageTagMutability"}
2190+
"imageTagMutability":{"shape":"ImageTagMutability"},
2191+
"imageTagMutabilityExclusionFilters":{"shape":"ImageTagMutabilityExclusionFilters"}
21592192
}
21602193
},
21612194
"PutLifecyclePolicyRequest":{
@@ -2364,6 +2397,7 @@
23642397
"repositoryUri":{"shape":"Url"},
23652398
"createdAt":{"shape":"CreationTimestamp"},
23662399
"imageTagMutability":{"shape":"ImageTagMutability"},
2400+
"imageTagMutabilityExclusionFilters":{"shape":"ImageTagMutabilityExclusionFilters"},
23672401
"imageScanningConfiguration":{"shape":"ImageScanningConfiguration"},
23682402
"encryptionConfiguration":{"shape":"EncryptionConfiguration"}
23692403
}
@@ -2383,6 +2417,7 @@
23832417
"encryptionConfiguration":{"shape":"EncryptionConfigurationForRepositoryCreationTemplate"},
23842418
"resourceTags":{"shape":"TagList"},
23852419
"imageTagMutability":{"shape":"ImageTagMutability"},
2420+
"imageTagMutabilityExclusionFilters":{"shape":"ImageTagMutabilityExclusionFilters"},
23862421
"repositoryPolicy":{"shape":"RepositoryPolicyText"},
23872422
"lifecyclePolicy":{"shape":"LifecyclePolicyTextForRepositoryCreationTemplate"},
23882423
"appliedFor":{"shape":"RCTAppliedForList"},
@@ -2841,6 +2876,7 @@
28412876
"encryptionConfiguration":{"shape":"EncryptionConfigurationForRepositoryCreationTemplate"},
28422877
"resourceTags":{"shape":"TagList"},
28432878
"imageTagMutability":{"shape":"ImageTagMutability"},
2879+
"imageTagMutabilityExclusionFilters":{"shape":"ImageTagMutabilityExclusionFilters"},
28442880
"repositoryPolicy":{"shape":"RepositoryPolicyText"},
28452881
"lifecyclePolicy":{"shape":"LifecyclePolicyTextForRepositoryCreationTemplate"},
28462882
"appliedFor":{"shape":"RCTAppliedForList"},

generator/ServiceModels/ecr/ecr-2015-09-21.docs.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -857,6 +857,36 @@
857857
"UpdateRepositoryCreationTemplateRequest$imageTagMutability": "<p>Updates the tag mutability setting for the repository. If this parameter is omitted, the default setting of <code>MUTABLE</code> will be used which will allow image tags to be overwritten. If <code>IMMUTABLE</code> is specified, all image tags within the repository will be immutable which will prevent them from being overwritten.</p>"
858858
}
859859
},
860+
"ImageTagMutabilityExclusionFilter": {
861+
"base": "<p>Overrides the default image tag mutability setting of the repository for image tags that match the specified filters.</p>",
862+
"refs": {
863+
"ImageTagMutabilityExclusionFilters$member": null
864+
}
865+
},
866+
"ImageTagMutabilityExclusionFilterType": {
867+
"base": null,
868+
"refs": {
869+
"ImageTagMutabilityExclusionFilter$filterType": "<p>Specifies the type of filter to use for excluding image tags from the repository's mutability setting.</p>"
870+
}
871+
},
872+
"ImageTagMutabilityExclusionFilterValue": {
873+
"base": null,
874+
"refs": {
875+
"ImageTagMutabilityExclusionFilter$filter": "<p>The value to use when filtering image tags. Must be either a regular expression pattern or a tag prefix value based on the specified filter type.</p>"
876+
}
877+
},
878+
"ImageTagMutabilityExclusionFilters": {
879+
"base": null,
880+
"refs": {
881+
"CreateRepositoryCreationTemplateRequest$imageTagMutabilityExclusionFilters": "<p>Creates a repository creation template with a list of filters that define which image tags can override the default image tag mutability setting.</p>",
882+
"CreateRepositoryRequest$imageTagMutabilityExclusionFilters": "<p>Creates a repository with a list of filters that define which image tags can override the default image tag mutability setting.</p>",
883+
"PutImageTagMutabilityRequest$imageTagMutabilityExclusionFilters": "<p>Creates or updates a repository with filters that define which image tags can override the default image tag mutability setting.</p>",
884+
"PutImageTagMutabilityResponse$imageTagMutabilityExclusionFilters": "<p>Returns a list of filters that were defined for a repository. These filters determine which image tags can override the default image tag mutability setting of the repository.</p>",
885+
"Repository$imageTagMutabilityExclusionFilters": "<p>The image tag mutability exclusion filters associated with the repository. These filters specify which image tags can override the repository's default image tag mutability setting.</p>",
886+
"RepositoryCreationTemplate$imageTagMutabilityExclusionFilters": "<p>Defines the image tag mutability exclusion filters to apply when creating repositories from this template. These filters specify which image tags can override the repository's default image tag mutability setting.</p>",
887+
"UpdateRepositoryCreationTemplateRequest$imageTagMutabilityExclusionFilters": "<p>Updates a repository with filters that define which image tags can override the default image tag mutability setting.</p>"
888+
}
889+
},
860890
"ImageTagsList": {
861891
"base": null,
862892
"refs": {

generator/ServiceModels/ecr/ecr-2015-09-21.normal.json

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1231,6 +1231,10 @@
12311231
"shape":"ImageTagMutability",
12321232
"documentation":"<p>The tag mutability setting for the repository. If this parameter is omitted, the default setting of <code>MUTABLE</code> will be used which will allow image tags to be overwritten. If <code>IMMUTABLE</code> is specified, all image tags within the repository will be immutable which will prevent them from being overwritten.</p>"
12331233
},
1234+
"imageTagMutabilityExclusionFilters":{
1235+
"shape":"ImageTagMutabilityExclusionFilters",
1236+
"documentation":"<p>Creates a repository creation template with a list of filters that define which image tags can override the default image tag mutability setting.</p>"
1237+
},
12341238
"repositoryPolicy":{
12351239
"shape":"RepositoryPolicyText",
12361240
"documentation":"<p>The repository policy to apply to repositories created using the template. A repository policy is a permissions policy associated with a repository to control access permissions. </p>"
@@ -1282,6 +1286,10 @@
12821286
"shape":"ImageTagMutability",
12831287
"documentation":"<p>The tag mutability setting for the repository. If this parameter is omitted, the default setting of <code>MUTABLE</code> will be used which will allow image tags to be overwritten. If <code>IMMUTABLE</code> is specified, all image tags within the repository will be immutable which will prevent them from being overwritten.</p>"
12841288
},
1289+
"imageTagMutabilityExclusionFilters":{
1290+
"shape":"ImageTagMutabilityExclusionFilters",
1291+
"documentation":"<p>Creates a repository with a list of filters that define which image tags can override the default image tag mutability setting.</p>"
1292+
},
12851293
"imageScanningConfiguration":{
12861294
"shape":"ImageScanningConfiguration",
12871295
"documentation":"<p>The image scanning configuration for the repository. This determines whether images are scanned for known vulnerabilities after being pushed to the repository.</p>"
@@ -2549,9 +2557,45 @@
25492557
"type":"string",
25502558
"enum":[
25512559
"MUTABLE",
2552-
"IMMUTABLE"
2560+
"IMMUTABLE",
2561+
"IMMUTABLE_WITH_EXCLUSION",
2562+
"MUTABLE_WITH_EXCLUSION"
25532563
]
25542564
},
2565+
"ImageTagMutabilityExclusionFilter":{
2566+
"type":"structure",
2567+
"required":[
2568+
"filterType",
2569+
"filter"
2570+
],
2571+
"members":{
2572+
"filterType":{
2573+
"shape":"ImageTagMutabilityExclusionFilterType",
2574+
"documentation":"<p>Specifies the type of filter to use for excluding image tags from the repository's mutability setting.</p>"
2575+
},
2576+
"filter":{
2577+
"shape":"ImageTagMutabilityExclusionFilterValue",
2578+
"documentation":"<p>The value to use when filtering image tags. Must be either a regular expression pattern or a tag prefix value based on the specified filter type.</p>"
2579+
}
2580+
},
2581+
"documentation":"<p>Overrides the default image tag mutability setting of the repository for image tags that match the specified filters.</p>"
2582+
},
2583+
"ImageTagMutabilityExclusionFilterType":{
2584+
"type":"string",
2585+
"enum":["WILDCARD"]
2586+
},
2587+
"ImageTagMutabilityExclusionFilterValue":{
2588+
"type":"string",
2589+
"max":128,
2590+
"min":1,
2591+
"pattern":"^[0-9a-zA-Z._*-]{1,128}$"
2592+
},
2593+
"ImageTagMutabilityExclusionFilters":{
2594+
"type":"list",
2595+
"member":{"shape":"ImageTagMutabilityExclusionFilter"},
2596+
"max":5,
2597+
"min":1
2598+
},
25552599
"ImageTagsList":{
25562600
"type":"list",
25572601
"member":{"shape":"ImageTag"}
@@ -3264,6 +3308,10 @@
32643308
"imageTagMutability":{
32653309
"shape":"ImageTagMutability",
32663310
"documentation":"<p>The tag mutability setting for the repository. If <code>MUTABLE</code> is specified, image tags can be overwritten. If <code>IMMUTABLE</code> is specified, all image tags within the repository will be immutable which will prevent them from being overwritten.</p>"
3311+
},
3312+
"imageTagMutabilityExclusionFilters":{
3313+
"shape":"ImageTagMutabilityExclusionFilters",
3314+
"documentation":"<p>Creates or updates a repository with filters that define which image tags can override the default image tag mutability setting.</p>"
32673315
}
32683316
}
32693317
},
@@ -3281,6 +3329,10 @@
32813329
"imageTagMutability":{
32823330
"shape":"ImageTagMutability",
32833331
"documentation":"<p>The image tag mutability setting for the repository.</p>"
3332+
},
3333+
"imageTagMutabilityExclusionFilters":{
3334+
"shape":"ImageTagMutabilityExclusionFilters",
3335+
"documentation":"<p>Returns a list of filters that were defined for a repository. These filters determine which image tags can override the default image tag mutability setting of the repository.</p>"
32843336
}
32853337
}
32863338
},
@@ -3595,6 +3647,10 @@
35953647
"shape":"ImageTagMutability",
35963648
"documentation":"<p>The tag mutability setting for the repository.</p>"
35973649
},
3650+
"imageTagMutabilityExclusionFilters":{
3651+
"shape":"ImageTagMutabilityExclusionFilters",
3652+
"documentation":"<p>The image tag mutability exclusion filters associated with the repository. These filters specify which image tags can override the repository's default image tag mutability setting.</p>"
3653+
},
35983654
"imageScanningConfiguration":{"shape":"ImageScanningConfiguration"},
35993655
"encryptionConfiguration":{
36003656
"shape":"EncryptionConfiguration",
@@ -3637,6 +3693,10 @@
36373693
"shape":"ImageTagMutability",
36383694
"documentation":"<p>The tag mutability setting for the repository. If this parameter is omitted, the default setting of <code>MUTABLE</code> will be used which will allow image tags to be overwritten. If <code>IMMUTABLE</code> is specified, all image tags within the repository will be immutable which will prevent them from being overwritten.</p>"
36393695
},
3696+
"imageTagMutabilityExclusionFilters":{
3697+
"shape":"ImageTagMutabilityExclusionFilters",
3698+
"documentation":"<p>Defines the image tag mutability exclusion filters to apply when creating repositories from this template. These filters specify which image tags can override the repository's default image tag mutability setting.</p>"
3699+
},
36403700
"repositoryPolicy":{
36413701
"shape":"RepositoryPolicyText",
36423702
"documentation":"<p>The repository policy to apply to repositories created using the template. A repository policy is a permissions policy associated with a repository to control access permissions. </p>"
@@ -4320,6 +4380,10 @@
43204380
"shape":"ImageTagMutability",
43214381
"documentation":"<p>Updates the tag mutability setting for the repository. If this parameter is omitted, the default setting of <code>MUTABLE</code> will be used which will allow image tags to be overwritten. If <code>IMMUTABLE</code> is specified, all image tags within the repository will be immutable which will prevent them from being overwritten.</p>"
43224382
},
4383+
"imageTagMutabilityExclusionFilters":{
4384+
"shape":"ImageTagMutabilityExclusionFilters",
4385+
"documentation":"<p>Updates a repository with filters that define which image tags can override the default image tag mutability setting.</p>"
4386+
},
43234387
"repositoryPolicy":{
43244388
"shape":"RepositoryPolicyText",
43254389
"documentation":"<p>Updates the repository policy created using the template. A repository policy is a permissions policy associated with a repository to control access permissions. </p>"

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -945,6 +945,12 @@
945945
<property>Amazon.ECR.Model.ImageReplicationStatus.RegistryId</property>
946946
<pattern>[0-9]{12}</pattern>
947947
</property-value-rule>
948+
<property-value-rule>
949+
<property>Amazon.ECR.Model.ImageTagMutabilityExclusionFilter.Filter</property>
950+
<min>1</min>
951+
<max>128</max>
952+
<pattern>^[0-9a-zA-Z._*-]{1,128}$</pattern>
953+
</property-value-rule>
948954
<property-value-rule>
949955
<property>Amazon.ECR.Model.InvalidLayerPartException.LastValidByteReceived</property>
950956
<min>0</min>

sdk/src/Services/ECR/Generated/Model/CreateRepositoryCreationTemplateRequest.cs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ public partial class CreateRepositoryCreationTemplateRequest : AmazonECRRequest
4444
private string _description;
4545
private EncryptionConfigurationForRepositoryCreationTemplate _encryptionConfiguration;
4646
private ImageTagMutability _imageTagMutability;
47+
private List<ImageTagMutabilityExclusionFilter> _imageTagMutabilityExclusionFilters = AWSConfigs.InitializeCollections ? new List<ImageTagMutabilityExclusionFilter>() : null;
4748
private string _lifecyclePolicy;
4849
private string _prefix;
4950
private string _repositoryPolicy;
@@ -155,6 +156,31 @@ internal bool IsSetImageTagMutability()
155156
return this._imageTagMutability != null;
156157
}
157158

159+
/// <summary>
160+
/// Gets and sets the property ImageTagMutabilityExclusionFilters.
161+
/// <para>
162+
/// Creates a repository creation template with a list of filters that define which image
163+
/// tags can override the default image tag mutability setting.
164+
/// </para>
165+
/// <para />
166+
/// Starting with version 4 of the SDK this property will default to null. If no data for this property is returned
167+
/// from the service the property will also be null. This was changed to improve performance and allow the SDK and caller
168+
/// to distinguish between a property not set or a property being empty to clear out a value. To retain the previous
169+
/// SDK behavior set the AWSConfigs.InitializeCollections static property to true.
170+
/// </summary>
171+
[AWSProperty(Min=1, Max=5)]
172+
public List<ImageTagMutabilityExclusionFilter> ImageTagMutabilityExclusionFilters
173+
{
174+
get { return this._imageTagMutabilityExclusionFilters; }
175+
set { this._imageTagMutabilityExclusionFilters = value; }
176+
}
177+
178+
// Check to see if ImageTagMutabilityExclusionFilters property is set
179+
internal bool IsSetImageTagMutabilityExclusionFilters()
180+
{
181+
return this._imageTagMutabilityExclusionFilters != null && (this._imageTagMutabilityExclusionFilters.Count > 0 || !AWSConfigs.InitializeCollections);
182+
}
183+
158184
/// <summary>
159185
/// Gets and sets the property LifecyclePolicy.
160186
/// <para>

sdk/src/Services/ECR/Generated/Model/CreateRepositoryRequest.cs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public partial class CreateRepositoryRequest : AmazonECRRequest
3939
private EncryptionConfiguration _encryptionConfiguration;
4040
private ImageScanningConfiguration _imageScanningConfiguration;
4141
private ImageTagMutability _imageTagMutability;
42+
private List<ImageTagMutabilityExclusionFilter> _imageTagMutabilityExclusionFilters = AWSConfigs.InitializeCollections ? new List<ImageTagMutabilityExclusionFilter>() : null;
4243
private string _registryId;
4344
private string _repositoryName;
4445
private List<Tag> _tags = AWSConfigs.InitializeCollections ? new List<Tag>() : null;
@@ -102,6 +103,31 @@ internal bool IsSetImageTagMutability()
102103
return this._imageTagMutability != null;
103104
}
104105

106+
/// <summary>
107+
/// Gets and sets the property ImageTagMutabilityExclusionFilters.
108+
/// <para>
109+
/// Creates a repository with a list of filters that define which image tags can override
110+
/// the default image tag mutability setting.
111+
/// </para>
112+
/// <para />
113+
/// Starting with version 4 of the SDK this property will default to null. If no data for this property is returned
114+
/// from the service the property will also be null. This was changed to improve performance and allow the SDK and caller
115+
/// to distinguish between a property not set or a property being empty to clear out a value. To retain the previous
116+
/// SDK behavior set the AWSConfigs.InitializeCollections static property to true.
117+
/// </summary>
118+
[AWSProperty(Min=1, Max=5)]
119+
public List<ImageTagMutabilityExclusionFilter> ImageTagMutabilityExclusionFilters
120+
{
121+
get { return this._imageTagMutabilityExclusionFilters; }
122+
set { this._imageTagMutabilityExclusionFilters = value; }
123+
}
124+
125+
// Check to see if ImageTagMutabilityExclusionFilters property is set
126+
internal bool IsSetImageTagMutabilityExclusionFilters()
127+
{
128+
return this._imageTagMutabilityExclusionFilters != null && (this._imageTagMutabilityExclusionFilters.Count > 0 || !AWSConfigs.InitializeCollections);
129+
}
130+
105131
/// <summary>
106132
/// Gets and sets the property RegistryId.
107133
/// <para>

0 commit comments

Comments
 (0)