Create an environment
Learn to create AWS Proton environments.
You can create an AWS Proton environment in one of two ways:
-
Create, manage, and provision a standard environment by using a standard environment template. AWS Proton provisions infrastructure for your environment.
-
Connect AWS Proton to customer-managed infrastructure by using a customer-managed environment template. You provision your own shared resources outside of AWS Proton, and then you provide provisioning outputs that AWS Proton can use.
You can choose one of several provisioning approaches when you create an environment.
-
AWS managed provisioning – Create, manage, and provision an environment in a single account. AWS Proton provisions your environment.
This method only supports CloudFormation infrastructure code (IaC) templates.
-
AWS managed provisioning to another account – In a single management account, create and manage an environment that's provisioned in another account with environment account connections. AWS Proton provisions your environment in the other account. For more information, see Create an environment in one account and provision in another account and Environment account connections.
This method only supports CloudFormation IaC templates.
-
Self-managed provisioning – AWS Proton submits provisioning pull requests to a linked repository with your own provisioning infrastructure.
This method only supports Terraform IaC templates.
-
CodeBuild provisioning – AWS Proton uses AWS CodeBuild to run shell commands that you provide. Your commands can read inputs that AWS Proton provides, and are responsible for provisioning or deprovisioning infrastructure and generating output values. A template bundle for this method includes your commands in a manifest file and any programs, scripts, or other files that these commands may need.
As an example to using CodeBuild provisioning, you can include code that uses the AWS Cloud Development Kit (AWS CDK) to provision AWS resources, and a manifest that installs the CDK and runs your CDK code.
For more information, see CodeBuild provisioning template bundle.
Note
You can use CodeBuild provisioning with environments and services. At this time you can't provision components this way.
With AWS managed provisioning (both in the same account and to another account), AWS Proton makes direct calls to provision your resources.
With self-managed provisioning, AWS Proton makes pull requests to provide compiled IaC files that your IaC engine uses to provision resources.
For more information, see How AWS Proton provisions infrastructure, Template bundles, and Schema requirements for environment template bundles.
Topics
Create and provision a standard environment in the same account
Use the console or AWS CLI to create and provision an environment in a single account. Provisioning is managed by AWS.
Create an environment in one account and provision in another account
Use the console or AWS CLI to create a standard environment in a management account that provisions environment infrastructure in another account. Provisioning is managed by AWS.
Before using the console or CLI, complete the following steps.
-
Identify the AWS account IDs for the management and environment account, and copy them for later use.
-
In the environment account, create an AWS Proton service role with minimum permissions for the environment to create. For more information, see AWS Proton service role for provisioning using AWS CloudFormation.
Create and provision an environment using self-managed provisioning
When you use self-managed provisioning, AWS Proton submits provisioning pull requests to a linked repository with your own provisioning infrastructure. The pull requests start your own workflow, which calls AWS services; to provision infrastructure.
Self-managed provisioning considerations:
-
Before you create an environment, set up a repository resource directory for self-managed provisioning. For more information, see AWS Proton infrastructure as code files.
-
After you create the environment, AWS Proton waits to receive asynchronous notifications regarding the status of your infrastructure provisioning. Your provisioning code must use the AWS Proton
NotifyResourceStateChange
API to send these asynchronous notifications to AWS Proton.
You can use self-managed provisioning in the console or with the AWS CLI. The following examples show how you can use self-managed provisioning with Terraform.