Skip to content

Commit

Permalink
feat(client-appconfig): Update KmsKeyIdentifier constraints to suppor…
Browse files Browse the repository at this point in the history
…t AWS KMS multi-Region keys.
  • Loading branch information
awstools committed Oct 20, 2023
1 parent 36836cf commit 81a0ee6
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 45 deletions.
48 changes: 25 additions & 23 deletions clients/client-appconfig/src/endpoint/ruleset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,29 @@ import { RuleSetObject } from "@smithy/types";
or see "smithy.rules#endpointRuleSet"
in codegen/sdk-codegen/aws-models/appconfig.json */

const s="required",
t="fn",
u="argv",
v="ref";
const a="isSet",
b="tree",
c="error",
d="endpoint",
e="PartitionResult",
f="stringEquals",
g={[s]:false,"type":"String"},
h={[s]:true,"default":false,"type":"Boolean"},
i={[v]:"Endpoint"},
j={[t]:"booleanEquals",[u]:[{[v]:"UseFIPS"},true]},
k={[t]:"booleanEquals",[u]:[{[v]:"UseDualStack"},true]},
l={},
m={[v]:"Region"},
n={[t]:"booleanEquals",[u]:[true,{[t]:"getAttr",[u]:[{[v]:e},"supportsFIPS"]}]},
o={[t]:"booleanEquals",[u]:[true,{[t]:"getAttr",[u]:[{[v]:e},"supportsDualStack"]}]},
p=[j],
q=[k],
r=[m];
const _data={version:"1.0",parameters:{Region:g,UseDualStack:h,UseFIPS:h,Endpoint:g},rules:[{conditions:[{[t]:a,[u]:[i]}],type:b,rules:[{conditions:p,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:c},{conditions:q,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:c},{endpoint:{url:i,properties:l,headers:l},type:d}]},{conditions:[{[t]:a,[u]:r}],type:b,rules:[{conditions:[{[t]:"aws.partition",[u]:r,assign:e}],type:b,rules:[{conditions:[j,k],type:b,rules:[{conditions:[n,o],type:b,rules:[{endpoint:{url:"https://appconfig-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:l,headers:l},type:d}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:c}]},{conditions:p,type:b,rules:[{conditions:[n],type:b,rules:[{conditions:[{[t]:f,[u]:[m,"us-gov-east-1"]}],endpoint:{url:"https://appconfig.us-gov-east-1.amazonaws.com",properties:l,headers:l},type:d},{conditions:[{[t]:f,[u]:[m,"us-gov-west-1"]}],endpoint:{url:"https://appconfig.us-gov-west-1.amazonaws.com",properties:l,headers:l},type:d},{endpoint:{url:"https://appconfig-fips.{Region}.{PartitionResult#dnsSuffix}",properties:l,headers:l},type:d}]},{error:"FIPS is enabled but this partition does not support FIPS",type:c}]},{conditions:q,type:b,rules:[{conditions:[o],type:b,rules:[{endpoint:{url:"https://appconfig.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:l,headers:l},type:d}]},{error:"DualStack is enabled but this partition does not support DualStack",type:c}]},{endpoint:{url:"https://appconfig.{Region}.{PartitionResult#dnsSuffix}",properties:l,headers:l},type:d}]}]},{error:"Invalid Configuration: Missing Region",type:c}]};
const u="required",
v="fn",
w="argv",
x="ref";
const a=true,
b="isSet",
c="booleanEquals",
d="error",
e="endpoint",
f="tree",
g="PartitionResult",
h="stringEquals",
i={[u]:false,"type":"String"},
j={[u]:true,"default":false,"type":"Boolean"},
k={[x]:"Endpoint"},
l={[v]:c,[w]:[{[x]:"UseFIPS"},true]},
m={[v]:c,[w]:[{[x]:"UseDualStack"},true]},
n={},
o={[x]:"Region"},
p={[v]:"getAttr",[w]:[{[x]:g},"supportsFIPS"]},
q={[v]:c,[w]:[true,{[v]:"getAttr",[w]:[{[x]:g},"supportsDualStack"]}]},
r=[l],
s=[m],
t=[o];
const _data={version:"1.0",parameters:{Region:i,UseDualStack:j,UseFIPS:j,Endpoint:i},rules:[{conditions:[{[v]:b,[w]:[k]}],rules:[{conditions:r,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:d},{conditions:s,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:d},{endpoint:{url:k,properties:n,headers:n},type:e}],type:f},{conditions:[{[v]:b,[w]:t}],rules:[{conditions:[{[v]:"aws.partition",[w]:t,assign:g}],rules:[{conditions:[l,m],rules:[{conditions:[{[v]:c,[w]:[a,p]},q],rules:[{endpoint:{url:"https://appconfig-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:n,headers:n},type:e}],type:f},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:d}],type:f},{conditions:r,rules:[{conditions:[{[v]:c,[w]:[p,a]}],rules:[{conditions:[{[v]:h,[w]:[o,"us-gov-east-1"]}],endpoint:{url:"https://appconfig.us-gov-east-1.amazonaws.com",properties:n,headers:n},type:e},{conditions:[{[v]:h,[w]:[o,"us-gov-west-1"]}],endpoint:{url:"https://appconfig.us-gov-west-1.amazonaws.com",properties:n,headers:n},type:e},{endpoint:{url:"https://appconfig-fips.{Region}.{PartitionResult#dnsSuffix}",properties:n,headers:n},type:e}],type:f},{error:"FIPS is enabled but this partition does not support FIPS",type:d}],type:f},{conditions:s,rules:[{conditions:[q],rules:[{endpoint:{url:"https://appconfig.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:n,headers:n},type:e}],type:f},{error:"DualStack is enabled but this partition does not support DualStack",type:d}],type:f},{endpoint:{url:"https://appconfig.{Region}.{PartitionResult#dnsSuffix}",properties:n,headers:n},type:e}],type:f}],type:f},{error:"Invalid Configuration: Missing Region",type:d}]};
export const ruleSet: RuleSetObject = _data;
50 changes: 28 additions & 22 deletions codegen/sdk-codegen/aws-models/appconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,6 @@
]
}
],
"type": "tree",
"rules": [
{
"conditions": [
Expand Down Expand Up @@ -424,7 +423,8 @@
},
"type": "endpoint"
}
]
],
"type": "tree"
},
{
"conditions": [
Expand All @@ -437,7 +437,6 @@
]
}
],
"type": "tree",
"rules": [
{
"conditions": [
Expand All @@ -451,7 +450,6 @@
"assign": "PartitionResult"
}
],
"type": "tree",
"rules": [
{
"conditions": [
Expand All @@ -474,7 +472,6 @@
]
}
],
"type": "tree",
"rules": [
{
"conditions": [
Expand Down Expand Up @@ -509,7 +506,6 @@
]
}
],
"type": "tree",
"rules": [
{
"conditions": [],
Expand All @@ -520,14 +516,16 @@
},
"type": "endpoint"
}
]
],
"type": "tree"
},
{
"conditions": [],
"error": "FIPS and DualStack are enabled, but this partition does not support one or both",
"type": "error"
}
]
],
"type": "tree"
},
{
"conditions": [
Expand All @@ -541,14 +539,12 @@
]
}
],
"type": "tree",
"rules": [
{
"conditions": [
{
"fn": "booleanEquals",
"argv": [
true,
{
"fn": "getAttr",
"argv": [
Expand All @@ -557,11 +553,11 @@
},
"supportsFIPS"
]
}
},
true
]
}
],
"type": "tree",
"rules": [
{
"conditions": [
Expand Down Expand Up @@ -610,14 +606,16 @@
},
"type": "endpoint"
}
]
],
"type": "tree"
},
{
"conditions": [],
"error": "FIPS is enabled but this partition does not support FIPS",
"type": "error"
}
]
],
"type": "tree"
},
{
"conditions": [
Expand All @@ -631,7 +629,6 @@
]
}
],
"type": "tree",
"rules": [
{
"conditions": [
Expand All @@ -651,7 +648,6 @@
]
}
],
"type": "tree",
"rules": [
{
"conditions": [],
Expand All @@ -662,14 +658,16 @@
},
"type": "endpoint"
}
]
],
"type": "tree"
},
{
"conditions": [],
"error": "DualStack is enabled but this partition does not support DualStack",
"type": "error"
}
]
],
"type": "tree"
},
{
"conditions": [],
Expand All @@ -680,9 +678,11 @@
},
"type": "endpoint"
}
]
],
"type": "tree"
}
]
],
"type": "tree"
},
{
"conditions": [],
Expand Down Expand Up @@ -4340,13 +4340,19 @@
"com.amazonaws.appconfig#KmsKeyIdentifier": {
"type": "string",
"traits": {
"smithy.api#pattern": "^[\\da-f]{8}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{12}|alias/[a-zA-Z0-9/_-]{1,250}|arn:aws[a-zA-Z-]*:kms:[a-z]{2}(-gov|-iso(b?))?-[a-z]+-\\d{1}:\\d{12}:(key/[0-9a-f-]{36}|alias/[a-zA-Z0-9/_-]{1,250})$"
"smithy.api#length": {
"min": 1,
"max": 2048
}
}
},
"com.amazonaws.appconfig#KmsKeyIdentifierOrEmpty": {
"type": "string",
"traits": {
"smithy.api#pattern": "^\\s{0,1}|[\\da-f]{8}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{12}|alias/[a-zA-Z0-9/_-]{1,250}|arn:aws[a-zA-Z-]*:kms:[a-z]{2}(-gov|-iso(b?))?-[a-z]+-\\d{1}:\\d{12}:(key/[0-9a-f-]{36}|alias/[a-zA-Z0-9/_-]{1,250})$"
"smithy.api#length": {
"min": 0,
"max": 2048
}
}
},
"com.amazonaws.appconfig#ListApplications": {
Expand Down

0 comments on commit 81a0ee6

Please sign in to comment.