From 81a0ee6c51285e1afb775aef947f3e892fb07761 Mon Sep 17 00:00:00 2001 From: awstools Date: Fri, 20 Oct 2023 20:11:32 +0000 Subject: [PATCH] feat(client-appconfig): Update KmsKeyIdentifier constraints to support AWS KMS multi-Region keys. --- .../client-appconfig/src/endpoint/ruleset.ts | 48 +++++++++--------- codegen/sdk-codegen/aws-models/appconfig.json | 50 +++++++++++-------- 2 files changed, 53 insertions(+), 45 deletions(-) diff --git a/clients/client-appconfig/src/endpoint/ruleset.ts b/clients/client-appconfig/src/endpoint/ruleset.ts index 91cf7db10524..1fecb43d23e8 100644 --- a/clients/client-appconfig/src/endpoint/ruleset.ts +++ b/clients/client-appconfig/src/endpoint/ruleset.ts @@ -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; diff --git a/codegen/sdk-codegen/aws-models/appconfig.json b/codegen/sdk-codegen/aws-models/appconfig.json index f8b25eed7c8e..67a43bd8b5f3 100644 --- a/codegen/sdk-codegen/aws-models/appconfig.json +++ b/codegen/sdk-codegen/aws-models/appconfig.json @@ -381,7 +381,6 @@ ] } ], - "type": "tree", "rules": [ { "conditions": [ @@ -424,7 +423,8 @@ }, "type": "endpoint" } - ] + ], + "type": "tree" }, { "conditions": [ @@ -437,7 +437,6 @@ ] } ], - "type": "tree", "rules": [ { "conditions": [ @@ -451,7 +450,6 @@ "assign": "PartitionResult" } ], - "type": "tree", "rules": [ { "conditions": [ @@ -474,7 +472,6 @@ ] } ], - "type": "tree", "rules": [ { "conditions": [ @@ -509,7 +506,6 @@ ] } ], - "type": "tree", "rules": [ { "conditions": [], @@ -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": [ @@ -541,14 +539,12 @@ ] } ], - "type": "tree", "rules": [ { "conditions": [ { "fn": "booleanEquals", "argv": [ - true, { "fn": "getAttr", "argv": [ @@ -557,11 +553,11 @@ }, "supportsFIPS" ] - } + }, + true ] } ], - "type": "tree", "rules": [ { "conditions": [ @@ -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": [ @@ -631,7 +629,6 @@ ] } ], - "type": "tree", "rules": [ { "conditions": [ @@ -651,7 +648,6 @@ ] } ], - "type": "tree", "rules": [ { "conditions": [], @@ -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": [], @@ -680,9 +678,11 @@ }, "type": "endpoint" } - ] + ], + "type": "tree" } - ] + ], + "type": "tree" }, { "conditions": [], @@ -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": {