Skip to content

Commit

Permalink
Restoring custom endpoint functionality for ECR Public
Browse files Browse the repository at this point in the history
  • Loading branch information
aws-sdk-dotnet-automation committed Dec 28, 2024
1 parent 64c6243 commit 5faed5f
Show file tree
Hide file tree
Showing 6 changed files with 865 additions and 95 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,25 @@
"documentation": "The AWS region used to dispatch the request.",
"type": "String"
},
"UseFIPS": {
"builtIn": "AWS::UseFIPS",
"UseDualStack": {
"builtIn": "AWS::UseDualStack",
"required": true,
"default": false,
"documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.",
"documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.",
"type": "Boolean"
},
"UseDualStack": {
"builtIn": "AWS::UseDualStack",
"UseFIPS": {
"builtIn": "AWS::UseFIPS",
"required": true,
"default": false,
"documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.",
"documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.",
"type": "Boolean"
},
"Endpoint": {
"builtIn": "SDK::Endpoint",
"required": false,
"documentation": "Override the endpoint used to send this request",
"type": "String"
}
},
"rules": [
Expand All @@ -29,18 +35,9 @@
"fn": "isSet",
"argv": [
{
"ref": "Region"
"ref": "Endpoint"
}
]
},
{
"fn": "aws.partition",
"argv": [
{
"ref": "Region"
}
],
"assign": "PartitionResult"
}
],
"rules": [
Expand All @@ -56,7 +53,7 @@
]
}
],
"error": "ECR Public does not support FIPS",
"error": "Invalid Configuration: FIPS and custom endpoint are not supported",
"type": "error"
},
{
Expand All @@ -71,57 +68,247 @@
]
}
],
"error": "Invalid Configuration: Dualstack and custom endpoint are not supported",
"type": "error"
},
{
"conditions": [],
"endpoint": {
"url": {
"ref": "Endpoint"
},
"properties": {},
"headers": {}
},
"type": "endpoint"
}
],
"type": "tree"
},
{
"conditions": [
{
"fn": "isSet",
"argv": [
{
"ref": "Region"
}
]
}
],
"rules": [
{
"conditions": [
{
"fn": "aws.partition",
"argv": [
{
"ref": "Region"
}
],
"assign": "PartitionResult"
}
],
"rules": [
{
"conditions": [
{
"fn": "booleanEquals",
"argv": [
true,
{
"fn": "getAttr",
"ref": "UseFIPS"
},
true
]
},
{
"fn": "booleanEquals",
"argv": [
{
"ref": "UseDualStack"
},
true
]
}
],
"rules": [
{
"conditions": [
{
"fn": "booleanEquals",
"argv": [
true,
{
"ref": "PartitionResult"
"fn": "getAttr",
"argv": [
{
"ref": "PartitionResult"
},
"supportsFIPS"
]
}
]
},
{
"fn": "booleanEquals",
"argv": [
true,
{
"fn": "getAttr",
"argv": [
{
"ref": "PartitionResult"
},
"supportsDualStack"
]
}
]
}
],
"rules": [
{
"conditions": [],
"endpoint": {
"url": "https://api.ecr-public-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",
"properties": {},
"headers": {}
},
"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": [
{
"fn": "booleanEquals",
"argv": [
{
"ref": "UseFIPS"
},
true
]
}
],
"rules": [
{
"conditions": [
{
"fn": "booleanEquals",
"argv": [
{
"fn": "getAttr",
"argv": [
{
"ref": "PartitionResult"
},
"supportsFIPS"
]
},
"supportsDualStack"
true
]
}
],
"rules": [
{
"conditions": [],
"endpoint": {
"url": "https://api.ecr-public-fips.{Region}.{PartitionResult#dnsSuffix}",
"properties": {},
"headers": {}
},
"type": "endpoint"
}
],
"type": "tree"
},
{
"conditions": [],
"error": "FIPS is enabled but this partition does not support FIPS",
"type": "error"
}
],
"type": "tree"
},
{
"conditions": [
{
"fn": "booleanEquals",
"argv": [
{
"ref": "UseDualStack"
},
true
]
}
],
"rules": [
{
"conditions": [
{
"fn": "booleanEquals",
"argv": [
true,
{
"fn": "getAttr",
"argv": [
{
"ref": "PartitionResult"
},
"supportsDualStack"
]
}
]
}
],
"rules": [
{
"conditions": [],
"endpoint": {
"url": "https://api.ecr-public.{Region}.{PartitionResult#dualStackDnsSuffix}",
"properties": {},
"headers": {}
},
"type": "endpoint"
}
],
"type": "tree"
},
{
"conditions": [],
"endpoint": {
"url": "https://ecr-public.{Region}.{PartitionResult#dualStackDnsSuffix}",
"properties": {},
"headers": {}
},
"type": "endpoint"
"error": "DualStack is enabled but this partition does not support DualStack",
"type": "error"
}
],
"type": "tree"
},
{
"conditions": [],
"error": "Dualstack is enabled but this partition does not support dualstack",
"type": "error"
"endpoint": {
"url": "https://api.ecr-public.{Region}.{PartitionResult#dnsSuffix}",
"properties": {},
"headers": {}
},
"type": "endpoint"
}
],
"type": "tree"
},
{
"conditions": [],
"endpoint": {
"url": "https://api.ecr-public.{Region}.{PartitionResult#dnsSuffix}",
"properties": {},
"headers": {}
},
"type": "endpoint"
}
],
"type": "tree"
},
{
"conditions": [],
"error": "Invalid Configuration: Missing Region",
"type": "error"
}
]
}
Loading

0 comments on commit 5faed5f

Please sign in to comment.