Access CloudFormation using an interface endpoint (AWS PrivateLink) (original) (raw)

You can use AWS PrivateLink to create a private connection between your VPC and CloudFormation. You can access CloudFormation as if it were in your VPC, without the use of an internet gateway, NAT device, VPN connection, or AWS Direct Connect connection. Instances in your VPC don't need public IP addresses to access CloudFormation.

You establish this private connection by creating an interface endpoint, powered by AWS PrivateLink. We create an endpoint network interface in each subnet that you enable for the interface endpoint. These are requester-managed network interfaces that serve as the entry point for traffic destined for CloudFormation.

CloudFormation supports making calls to all of its API actions through the interface endpoint.

Considerations for CloudFormation VPC endpoints

Before you set up an interface endpoint, first make sure you have met the prerequisites in the Access an AWS service using an interface VPC endpoint topic in the_AWS PrivateLink Guide_.

The following additional prerequisites and considerations apply when setting up an interface endpoint for CloudFormation:

Creating an interface VPC endpoint for CloudFormation

You can create a VPC endpoint for CloudFormation using either the Amazon VPC console or the AWS Command Line Interface (AWS CLI). For more information, see Create a VPC endpoint in the_AWS PrivateLink Guide_.

Create an interface endpoint for CloudFormation using the following service name:

If you enable private DNS for the interface endpoint, you can make API requests to CloudFormation using its default Regional DNS name. For example,cloudformation.us-east-1.amazonaws.com.

Creating a VPC endpoint policy for CloudFormation

An endpoint policy is an IAM resource that you can attach to an interface endpoint. The default endpoint policy allows full access to CloudFormation through the interface endpoint. To control the access allowed to CloudFormation from your VPC, attach a custom endpoint policy to the interface endpoint.

An endpoint policy specifies the following information:

For more information, see Control access to VPC endpoints using endpoint policies in the_AWS PrivateLink Guide_.

Example: VPC endpoint policy for CloudFormation actions

The following is an example of an endpoint policy for CloudFormation. When attached to an endpoint, this policy grants access to the listed CloudFormation actions for all principals on all resources. The following example denies all users the permission to create stacks through the VPC endpoint, and allows full access to all other actions on the CloudFormation service.

{
  "Statement": [
    {
      "Action": "cloudformation:*", 
      "Effect": "Allow", 
      "Principal": "*", 
      "Resource": "*"
    },
    {
      "Action": "cloudformation:CreateStack", 
      "Effect": "Deny", 
      "Principal": "*", 
      "Resource": "*"
    }
  ]
}