API provider: Share your private custom domain name using Amazon RAM
You can provide API consumers in other Amazon Web Services accounts access to your private custom domain name. In this section, you learn how to share your private custom domain name using Amazon RAM and how to control access to your private custom domain name.
Considerations for sharing your private custom domain name
The following considerations might impact how you provide access to your private custom domain name using Amazon RAM. To learn how to share your private custom domain name without using Amazon RAM, see API provider: Share your private custom domain name using the API Gateway Amazon CLI.
-
Private custom domain names are shared at the Amazon Web Services Region level. Both the private custom domain name and the VPC endpoint need to be in the same Amazon Web Services Region.
-
You can use one resource share with multiple principals, and after you create the resource share, you can add more principals to it. We recommend that when possible, you reuse your resource share.
-
You always need to grant the API consumer's VPC endpoint access to invoke your private custom domain name and any private APIs mapped to it.
-
If the API consumer and API provider are in the same organization using Amazon Organizations, the resource share is automatically accepted. You still need to create the resource share using Amazon RAM.
-
If the API consumer and API provider are in the same organization using Amazon Organizations and resource sharing within your organization is enabled, any principals in the organization that you share with are automatically granted access to the resource shares. There is no need for an invitation and you can skip the resource share.
-
If the API consumer doesn't accept the resource share within 12 hours, the API provider must share the resource again.
-
After you create the resource share, Amazon RAM updates the
managementPolicy
for the Amazon API Gateway Management service for your private custom domain name to prevent access to principals without explicitallow
access. For more information, see Determining whether a request is allowed or denied within an account in the IAM User Guide.The updated
managementPolicy
will look like the following:{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": "*", "Action": "execute-api:Invoke", "Resource": [ "execute-api:/*" ] }, { "Effect": "Deny", "Principal": "*", "Action": "execute-api:Invoke", "Resource": [ "execute-api:/*" ], "Condition" : { "StringNotEquals": { "aws:SourceVpce": "
vpce-abcd1234efg
" } } } ] }Amazon RAM has prevented principals without explicit
allow
access to create access associations with your private custom domain name, by adding the following:"StringNotEquals": { "aws:PrincipalAccount": "111122223333" }
You can still use the principal in the Amazon Web Services account who created the private custom domain name to create domain name access associations.
Allow other accounts to create domain name access associations with your private custom domain name
First, you grant access to another Amazon Web Services account to create domain name access associations with your private custom domain name.
After you have provided access to another Amazon Web Services account, API consumers in that account must create a domain name access association between their VPC endpoint with your private custom domain name. You can't create the domain name access association for them. For more information, see Associate your VPC endpoint with a shared private custom domain name.
Allow other accounts to invoke your private custom domain name
Next, you grant access for the API consumer's VPC endpoint to invoke your private custom domain name and any private APIs mapped to it.