Skip to content

Commit c90d655

Browse files
Fixed the validation pattern for an instance profile Amazon Resource Name (ARN) in AWS PCS.
1 parent c484951 commit c90d655

File tree

4 files changed

+58
-27
lines changed

4 files changed

+58
-27
lines changed

generator/ServiceModels/pcs/pcs-2023-02-10.api.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,7 @@
848848
},
849849
"InstanceProfileArn":{
850850
"type":"string",
851-
"pattern":"arn:aws([a-zA-Z-]{0,10})?:iam::[0-9]{12}:instance-profile/[\\w+=,.@-]{1,128}"
851+
"pattern":"arn:aws([a-zA-Z-]{0,10})?:iam::[0-9]{12}:instance-profile/[/\\w+=,.@-]{1,128}"
852852
},
853853
"Integer":{
854854
"type":"integer",

generator/ServiceModels/pcs/pcs-2023-02-10.normal.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1168,7 +1168,7 @@
11681168
},
11691169
"InstanceProfileArn":{
11701170
"type":"string",
1171-
"pattern":"arn:aws([a-zA-Z-]{0,10})?:iam::[0-9]{12}:instance-profile/[\\w+=,.@-]{1,128}"
1171+
"pattern":"arn:aws([a-zA-Z-]{0,10})?:iam::[0-9]{12}:instance-profile/[/\\w+=,.@-]{1,128}"
11721172
},
11731173
"Integer":{
11741174
"type":"integer",

generator/ServiceModels/pcs/pcs-2023-02-10.smoke2.json

Lines changed: 53 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
{
22
"version" : 2,
33
"testCases" : [ {
4-
"id" : "ListClustersSuccess",
5-
"operationName" : "ListClusters",
6-
"input" : { },
4+
"id" : "GetCluster_AccessDeniedException",
5+
"operationName" : "GetCluster",
6+
"input" : {
7+
"clusterIdentifier" : "pcs_donotexist"
8+
},
79
"expectation" : {
8-
"success" : { }
10+
"failure" : {
11+
"errorId" : "AccessDeniedException"
12+
}
913
},
1014
"config" : {
1115
"region" : "us-west-2",
@@ -14,10 +18,11 @@
1418
"useAccountIdRouting" : true
1519
}
1620
}, {
17-
"id" : "ListComputeNodeGroups_AccessDeniedException",
18-
"operationName" : "ListComputeNodeGroups",
21+
"id" : "GetComputeNodeGroup_AccessDeniedException",
22+
"operationName" : "GetComputeNodeGroup",
1923
"input" : {
20-
"clusterIdentifier" : "pcs_donotexist"
24+
"clusterIdentifier" : "pcs_donotexist",
25+
"computeNodeGroupIdentifier" : "pcs_donotexist"
2126
},
2227
"expectation" : {
2328
"failure" : {
@@ -31,10 +36,11 @@
3136
"useAccountIdRouting" : true
3237
}
3338
}, {
34-
"id" : "ListQueueFailure_AccessDeniedException",
35-
"operationName" : "ListQueues",
39+
"id" : "GetQueueFailure_AccessDeniedException",
40+
"operationName" : "GetQueue",
3641
"input" : {
37-
"clusterIdentifier" : "pcs_donotexist"
42+
"clusterIdentifier" : "pcs_donotexist",
43+
"queueIdentifier" : "pcs_donotexist"
3844
},
3945
"expectation" : {
4046
"failure" : {
@@ -48,11 +54,10 @@
4854
"useAccountIdRouting" : true
4955
}
5056
}, {
51-
"id" : "GetComputeNodeGroup_AccessDeniedException",
52-
"operationName" : "GetComputeNodeGroup",
57+
"id" : "ListComputeNodeGroups_AccessDeniedException",
58+
"operationName" : "ListComputeNodeGroups",
5359
"input" : {
54-
"clusterIdentifier" : "pcs_donotexist",
55-
"computeNodeGroupIdentifier" : "pcs_donotexist"
60+
"clusterIdentifier" : "pcs_donotexist"
5661
},
5762
"expectation" : {
5863
"failure" : {
@@ -66,28 +71,54 @@
6671
"useAccountIdRouting" : true
6772
}
6873
}, {
69-
"id" : "GetCluster_AccessDeniedException",
70-
"operationName" : "GetCluster",
74+
"id" : "ListClustersSuccess",
75+
"operationName" : "ListClusters",
76+
"input" : { },
77+
"expectation" : {
78+
"success" : { }
79+
},
80+
"config" : {
81+
"region" : "us-west-2",
82+
"useFips" : false,
83+
"useDualstack" : false,
84+
"useAccountIdRouting" : true
85+
}
86+
}, {
87+
"id" : "InstanceArnSuccess",
88+
"operationName" : "CreateComputeNodeGroup",
7189
"input" : {
72-
"clusterIdentifier" : "pcs_donotexist"
90+
"clusterIdentifier" : "testCluster",
91+
"computeNodeGroupName" : "testNodeGroupName",
92+
"subnetIds" : [ "subnet-0cbf727bae9405b47" ],
93+
"scalingConfiguration" : {
94+
"minInstanceCount" : 1,
95+
"maxInstanceCount" : 1
96+
},
97+
"iamInstanceProfileArn" : "arn:aws:iam::975050141277:instance-profile/aws-pcs/example-role-2",
98+
"customLaunchTemplate" : {
99+
"id" : "lt-0b8f8ee3f92b73dc0",
100+
"version" : "1"
101+
},
102+
"instanceConfigs" : [ {
103+
"instanceType" : "t3.medium"
104+
} ]
73105
},
74106
"expectation" : {
75107
"failure" : {
76108
"errorId" : "AccessDeniedException"
77109
}
78110
},
79111
"config" : {
80-
"region" : "us-west-2",
112+
"region" : "us-east-1",
81113
"useFips" : false,
82114
"useDualstack" : false,
83115
"useAccountIdRouting" : true
84116
}
85117
}, {
86-
"id" : "GetQueueFailure_AccessDeniedException",
87-
"operationName" : "GetQueue",
118+
"id" : "ListQueueFailure_AccessDeniedException",
119+
"operationName" : "ListQueues",
88120
"input" : {
89-
"clusterIdentifier" : "pcs_donotexist",
90-
"queueIdentifier" : "pcs_donotexist"
121+
"clusterIdentifier" : "pcs_donotexist"
91122
},
92123
"expectation" : {
93124
"failure" : {

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
</property-value-rule>
3333
<property-value-rule>
3434
<property>Amazon.PCS.Model.CreateComputeNodeGroupRequest.IamInstanceProfileArn</property>
35-
<pattern>arn:aws([a-zA-Z-]{0,10})?:iam::[0-9]{12}:instance-profile/[\w+=,.@-]{1,128}</pattern>
35+
<pattern>arn:aws([a-zA-Z-]{0,10})?:iam::[0-9]{12}:instance-profile/[/\w+=,.@-]{1,128}</pattern>
3636
</property-value-rule>
3737
<property-value-rule>
3838
<property>Amazon.PCS.Model.CreateQueueRequest.ClientToken</property>
@@ -174,7 +174,7 @@
174174
</property-value-rule>
175175
<property-value-rule>
176176
<property>Amazon.PCS.Model.UpdateComputeNodeGroupRequest.IamInstanceProfileArn</property>
177-
<pattern>arn:aws([a-zA-Z-]{0,10})?:iam::[0-9]{12}:instance-profile/[\w+=,.@-]{1,128}</pattern>
177+
<pattern>arn:aws([a-zA-Z-]{0,10})?:iam::[0-9]{12}:instance-profile/[/\w+=,.@-]{1,128}</pattern>
178178
</property-value-rule>
179179
<property-value-rule>
180180
<property>Amazon.PCS.Model.UpdateQueueRequest.ClientToken</property>
@@ -213,7 +213,7 @@
213213
</property-value-rule>
214214
<property-value-rule>
215215
<property>Amazon.PCS.Model.ComputeNodeGroup.IamInstanceProfileArn</property>
216-
<pattern>arn:aws([a-zA-Z-]{0,10})?:iam::[0-9]{12}:instance-profile/[\w+=,.@-]{1,128}</pattern>
216+
<pattern>arn:aws([a-zA-Z-]{0,10})?:iam::[0-9]{12}:instance-profile/[/\w+=,.@-]{1,128}</pattern>
217217
</property-value-rule>
218218
<property-value-rule>
219219
<property>Amazon.PCS.Model.ComputeNodeGroup.Name</property>

0 commit comments

Comments
 (0)