To stop sharing your private custom domain name, first you stop the API consumer from creating more domain
name access associations by dissociating the resource share. Then, you reject the domain name access
association and remove the API consumer's VPC endpoint from your policy
for the
execute-api
service. The API consumer can then delete their
domain name access association.
Stop sharing your private custom domain name
First, you stop the resource share using AWS RAM.
To use the AWS Management Console, see Update a resource share in AWS RAM.
Reject the domain name access association
After you stop sharing your resource using AWS RAM, you reject the domain name access association between a VPC endpoint in another account and your private custom domain name.
Note
You can't reject a domain name access association in your own account. To stop resource sharing, delete the domain name access association. For more information, see Delete a domain name access association.
When you reject a domain name access association with
a VPC endpoint, if an API consumer tries to call your private custom domain name, API Gateway rejects the call and
returns a 403
status code.
To reject a domain name access association
Sign in to the API Gateway console at https://console.aws.amazon.com/apigateway
. -
In the main navigation pane, choose Custom domain names.
-
Choose the private custom domain name that you shared with other AWS accounts.
-
On the Resource sharing, choose the domain name access association you want to reject.
Choose Reject association.
-
Confirm your choice, and then choose Reject.
Deny the API provider access to invoke your private custom
domain name
After you reject the domain name access association, you remove the API consumer's VPC endpoint from your policy
for the
execute-api
service.
To remove the API consumer's VPC endpoint from your resource policy
-
Sign in to the API Gateway console at https://console.aws.amazon.com/apigateway
. -
In the main navigation pane, choose Custom domain names.
-
Choose the private custom domain name that you shared with other AWS accounts.
-
On the Resource policy tab, choose Edit.
Remove the VPC endpoint from the policy.
Choose Save changes.
The API consumer should then delete the domain name access association. You can't delete it for them. For more information, see API consumer: Delete your domain name access association with a private custom domain name.