| « PreviousNext » | |
![]() ![]() ![]() | Did this page help you? Yes | No | Tell us about it... |
Topics
This section describes the resources and conditions that you can use in policy statements to grant permissions that allow specific AWS Elastic Beanstalk actions to be performed on specific AWS Elastic Beanstalk resources.
Note
Some AWS Elastic Beanstalk actions may require permissions to other AWS services. For example, the following policy gives permissions for all Auto Scaling, Amazon S3, Amazon EC2, Amazon CloudWatch, Amazon SNS, Elastic Load Balancing, Amazon RDS, and AWS CloudFormation (for non-legacy container types) actions required to complete any AWS Elastic Beanstalk action. AWS Elastic Beanstalk relies on these additional services to provision underlying resources when creating an environment. For a list of supported non-legacy container types, see Why are some container types marked legacy?.
The following policy is an example. It gives a broad set of permissions to the AWS products that AWS Elastic Beanstalk uses to manage applications
and environments. For example, ec2:* allows an IAM user to perform any action on any Amazon EC2 resource in the AWS account. These
permissions are not limited to the resources that you use with AWS Elastic Beanstalk. As a best practice, you should grant individuals only the permissions
they need to perform their duties.
{
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:*",
"elasticloadbalancing:*",
"autoscaling:*",
"cloudwatch:*",
"s3:*",
"sns:*",
"rds:*",
"cloudformation:*"
],
"Resource": "*"
}
]
}To use IAM roles with AWS Elastic Beanstalk, you need to have the appropriate permissions for AWS Elastic Beanstalk to create a default profile for you, or to view the list of instance profiles available in your environment. You need to check to make sure your policy is updated with the correct permissions. If you tried to create or update your environment using an instance profile, and you received an error, it may be because you do not have permission. Your account administrator should add the following actions to your policy:
"iam:AddRoleToInstanceProfile", "iam:CreateInstanceProfile", "iam:CreateRole", "iam:PassRole", "iam:ListInstanceProfiles"
The following example shows one statement that gives a broad set of permissions to AWS products that AWS Elastic Beanstalk uses to manage applications and environments and includes permissions to create an instance profile and view a list of available instance profiles.
{
"Statement": [
{
"Effect": "Allow",
"Action": [
"elasticbeanstalk:*",
"ec2:*",
"elasticloadbalancing:*",
"autoscaling:*",
"cloudwatch:*",
"s3:*",
"sns:*",
"cloudformation:*",
"rds:*",
"iam:AddRoleToInstanceProfile",
"iam:CreateInstanceProfile",
"iam:CreateRole",
"iam:PassRole",
"iam:ListInstanceProfiles"
],
"Resource": "*"
}
]
} The following table lists all AWS Elastic Beanstalk actions, the resource that each action acts upon, and the additional contextual information that can be provided using conditions.
Conditions enable you to specify permissions to resources that the action needs to
complete. For example, when you can call the CreateEnvironment
action, you must also specify the application version to deploy as well as the
application that contains that application name. When you set permissions for
the CreateEnvironment action, you specify the application and
application version that you want the action to act upon by using the
InApplication and FromApplicationVersion
conditions. In addition, you can specify the environment configuration with a
solution stack (FromSolutionStack) or a configuration template
(FromConfigurationTemplate). The following policy statement
allows the CreateEnvironment action to create an environment with
the name myenv (specified by Resource) in
the application My App (specified by the
InApplication condition) using the application version
My Version (FromApplicationVersion) with
a 32bit Amazon Linux running Tomcat 7 configuration
(FromSolutionStack):
{
"Statement": [
{
"Action": [
"elasticbeanstalk:CreateEnvironment"
],
"Effect": "Allow",
"Resource": [
"arn:aws:elasticbeanstalk:us-east-1:123456789012:environment/My App/myenv"
],
"Condition": {
"StringEquals": {
"elasticbeanstalk:InApplication": ["arn:aws:elasticbeanstalk:us-east-1:123456789012:application/My App"],
"elasticbeanstalk:FromApplicationVersion": ["arn:aws:elasticbeanstalk:us-east-1:123456789012:applicationversion/My App/My Version"],
"elasticbeanstalk:FromSolutionStack": ["arn:aws:elasticbeanstalk:us-east-1::solutionstack/32bit Amazon Linux running Tomcat 7"]
}
}
}
]
}As you can see in the preceding example, resources are specified using their Amazon Resource Name (ARN). For more information about the ARN format for AWS Elastic Beanstalk resources, see Amazon Resource Name (ARN) Format for AWS Elastic Beanstalk.
The Comments column contains a simple example statement that grants permission to use the action on a specific resource with the appropriate contextual information provided through one or more conditions. The Comments column also lists dependencies that the action may have on permissions to perform other actions or to access other resources.
Note
If you set a policy on elasticbeanstalk:Describe* actions, those actions return
only values that are permitted through the policy. For example, the
following policy allows the elasticbeanstalk:DescribeEvents
action to return a list of event descriptions for the environment
myenv in the application My
App. If you applied this policy to a user, that user could
successfully perform the elasticbeanstalk:DescribeEvents action
using myenv for the EnvironmentName
parameter to get the list of events for myenv.
However, if the user used another environment name for
EnvironmentName or specified different parameters such as
one for a specific application version, the action would return no event
descriptions because the user has permission to view
onlymyenv events. If the user specified no
parameters for elasticbeanstalk:DescribeEvents, the action
would return only the events for myenv because that
is the only resource the user has permissions for.
{
"Statement": [
{
"Action": "elasticbeanstalk:DescribeEvents",
"Effect": "Allow",
"Resource": [
"arn:aws:elasticbeanstalk:us-east-1:123456789012:environment/My App/myenv"
],
"Condition": {
"StringEquals": {
"elasticbeanstalk:InApplication": ["arn:aws:elasticbeanstalk:us-east-1:123456789012:application/My App"]
}
}
}
]
}Policy information for AWS Elastic Beanstalk actions, including resources, conditions, examples, and dependencies
| Resource | Conditions | Comments |
|---|---|---|
Action: | ||
|
|
N/A |
This example allows the {
"Statement": [
{
"Action": [
"elasticbeanstalk:CheckDNSAvailability"
],
"Effect": "Allow",
"Resource": "*"
}
]
}
|
Action: | ||
|
|
N/A |
This example allows the {
"Statement": [
{
"Action": [
"elasticbeanstalk:CreateApplication"
],
"Effect": "Allow",
"Resource": [
"arn:aws:elasticbeanstalk:us-east-1:123456789012:application/DivA*"
]
}
]
}
|
Action: | ||
|
|
|
This example allows the {
"Statement": [
{
"Action": [
"elasticbeanstalk:CreateApplicationVersion"
],
"Effect": "Allow",
"Resource": [
"arn:aws:elasticbeanstalk:us-east-1:123456789012:applicationversion/My App/*"
],
"Condition": {
"StringEquals": {
"elasticbeanstalk:InApplication": ["arn:aws:elasticbeanstalk:us-east-1:123456789012:application/My App"]
}
}
}
]
}
|
Action: | ||
|
|
|
This example allows the
{
"Statement": [
{
"Action": [
"elasticbeanstalk:CreateConfigurationTemplate"
],
"Effect": "Allow",
"Resource": [
"arn:aws:elasticbeanstalk:us-east-1:123456789012:configurationtemplate/My App/My Template*"
],
"Condition": {
"StringEquals": {
"elasticbeanstalk:InApplication": ["arn:aws:elasticbeanstalk:us-east-1:123456789012:application/My App"],
"elasticbeanstalk:FromSolutionStack": ["arn:aws:elasticbeanstalk:us-east-1::solutionstack/32bit Amazon Linux running Tomcat 7"]
}
}
}
]
}
|
Action: | ||
|
|
|
This example allows the {
"Statement": [
{
"Action": [
"elasticbeanstalk:CreateEnvironment"
],
"Effect": "Allow",
"Resource": [
"arn:aws:elasticbeanstalk:us-east-1:123456789012:environment/My App/myenv"
],
"Condition": {
"StringEquals": {
"elasticbeanstalk:InApplication": ["arn:aws:elasticbeanstalk:us-east-1:123456789012:application/My App"],
"elasticbeanstalk:FromApplicationVersion": ["arn:aws:elasticbeanstalk:us-east-1:123456789012:applicationversion/My App/My Version"],
"elasticbeanstalk:FromSolutionStack": ["arn:aws:elasticbeanstalk:us-east-1::solutionstack/32bit Amazon Linux running Tomcat 7"]
}
}
}
]
}
|
Action: | ||
|
|
N/A |
This example allows the {
"Statement": [
{
"Action": [
"elasticbeanstalk:CreateStorageLocation"
],
"Effect": "Allow",
"Resource": "*"
}
]
}
|
Action: | ||
|
|
N/A |
This example allows the {
"Statement": [
{
"Action": [
"elasticbeanstalk:DeleteApplication"
],
"Effect": "Allow",
"Resource": [
"arn:aws:elasticbeanstalk:us-east-1:123456789012:application/My App"
]
}
]
}
|
Action: | ||
|
|
|
This example allows the {
"Statement": [
{
"Action": [
"elasticbeanstalk:DeleteApplicationVersion"
],
"Effect": "Allow",
"Resource": [
"arn:aws:elasticbeanstalk:us-east-1:123456789012:applicationversion/My App/My Version"
],
"Condition": {
"StringEquals": {
"elasticbeanstalk:InApplication": ["arn:aws:elasticbeanstalk:us-east-1:123456789012:application/My App"]
}
}
}
]
}
|
Action: | ||
|
|
|
This example allows the
{
"Statement": [
{
"Action": [
"elasticbeanstalk:DeleteConfigurationTemplate"
],
"Effect": "Allow",
"Resource": [
"arn:aws:elasticbeanstalk:us-east-1:123456789012:configurationtemplate/My App/My Template"
]
}
]
}
|
Action: | ||
|
|
|
This example allows the
{
"Statement": [
{
"Action": [
"elasticbeanstalk:DeleteEnvironmentConfiguration"
],
"Effect": "Allow",
"Resource": [
"arn:aws:elasticbeanstalk:us-east-1:123456789012:environment/My App/myenv"
]
}
]
}
|
Action: | ||
|
|
|
This example allows the
{
"Statement": [
{
"Action": [
"elasticbeanstalk:DescribeApplicationVersions"
],
"Effect": "Allow",
"Resource": [
"arn:aws:elasticbeanstalk:us-east-1:123456789012:applicationversion/My App/My Version"
]
}
]
}
|
Action: | ||
|
|
N/A |
This example allows the {
"Statement": [
{
"Action": [
"elasticbeanstalk:DescribeApplications"
],
"Effect": "Allow",
"Resource": [
"arn:aws:elasticbeanstalk:us-east-1:123456789012:application/My App"
]
}
]
}
|
Action: | ||
|
|
|
This example allows the
{
"Statement": [
{
"Action": "elasticbeanstalk:DescribeConfigurationOptions",
"Effect": "Allow",
"Resource": [
"arn:aws:elasticbeanstalk:us-east-1:123456789012:environment/My App/myenv"
]
}
]
}
|
Action: | ||
|
|
|
This example allows the
{
"Statement": [
{
"Action": "elasticbeanstalk:DescribeConfigurationSettings",
"Effect": "Allow",
"Resource": [
"arn:aws:elasticbeanstalk:us-east-1:123456789012:environment/My App/myenv"
]
}
]
}
|
Action: | ||
|
|
|
This example allows the
{
"Statement": [
{
"Action": "elasticbeanstalk:DescribeEnvironmentResources",
"Effect": "Allow",
"Resource": [
"arn:aws:elasticbeanstalk:us-east-1:123456789012:environment/My App/myenv"
]
}
]
}
|
Action: | ||
|
|
|
This example allows the {
"Statement": [
{
"Action": "elasticbeanstalk:DescribeEnvironments",
"Effect": "Allow",
"Resource": [
"arn:aws:elasticbeanstalk:us-east-1:123456789012:environment/My App/myenv",
"arn:aws:elasticbeanstalk:us-east-1:123456789012:environment/My App2/myotherenv"
]
}
]
}
|
Action: | ||
|
|
|
This example allows the {
"Statement": [
{
"Action": "elasticbeanstalk:DescribeEvents",
"Effect": "Allow",
"Resource": [
"arn:aws:elasticbeanstalk:us-east-1:123456789012:environment/My App/myenv",
"arn:aws:elasticbeanstalk:us-east-1:123456789012:applicationversion/My App/My Version"
],
"Condition": {
"StringEquals": {
"elasticbeanstalk:InApplication": ["arn:aws:elasticbeanstalk:us-east-1:123456789012:application/My App"]
}
}
}
]
}
|
Action: | ||
|
|
N/A |
This example allows the
{
"Statement": [
{
"Action": [
"elasticbeanstalk:ListAvailableSolutionStacks"
],
"Effect": "Allow",
"Resource": "arn:aws:elasticbeanstalk:us-east-1::solutionstack/32bit Amazon Linux running Tomcat 7"
}
]
}
|
Action: | ||
|
|
|
This example allows the {
"Statement": [
{
"Action": [
"elasticbeanstalk:RebuildEnvironment"
],
"Effect": "Allow",
"Resource": [
"arn:aws:elasticbeanstalk:us-east-1:123456789012:environment/My App/myenv"
],
"Condition": {
"StringEquals": {
"elasticbeanstalk:InApplication": ["arn:aws:elasticbeanstalk:us-east-1:123456789012:application/My App"]
}
}
}
]
}
|
Action: | ||
|
|
|
This example allows the {
"Statement": [
{
"Action": [
"elasticbeanstalk:RequestEnvironmentInfo"
],
"Effect": "Allow",
"Resource": [
"arn:aws:elasticbeanstalk:us-east-1:123456789012:environment/My App/myenv"
],
"Condition": {
"StringEquals": {
"elasticbeanstalk:InApplication": ["arn:aws:elasticbeanstalk:us-east-1:123456789012:application/My App"]
}
}
}
]
}
|
Action: | ||
|
|
|
This example allows the {
"Statement": [
{
"Action": [
"elasticbeanstalk:RestartAppServer"
],
"Effect": "Allow",
"Resource": [
"arn:aws:elasticbeanstalk:us-east-1:123456789012:environment/My App/myenv"
],
"Condition": {
"StringEquals": {
"elasticbeanstalk:InApplication": ["arn:aws:elasticbeanstalk:us-east-1:123456789012:application/My App"]
}
}
}
]
}
|
Action: | ||
|
|
|
This example allows the {
"Statement": [
{
"Action": [
"elasticbeanstalk:RetrieveEnvironmentInfo"
],
"Effect": "Allow",
"Resource": [
"arn:aws:elasticbeanstalk:us-east-1:123456789012:environment/My App/myenv"
],
"Condition": {
"StringEquals": {
"elasticbeanstalk:InApplication": ["arn:aws:elasticbeanstalk:us-east-1:123456789012:application/My App"]
}
}
}
]
}
|
Action: | ||
|
|
|
This example allows the {
"Statement": [
{
"Action": [
"elasticbeanstalk:SwapEnvironmentCNAMEs"
],
"Effect": "Allow",
"Resource": [
"arn:aws:elasticbeanstalk:us-east-1:123456789012:environment/My App/mysrcenv",
"arn:aws:elasticbeanstalk:us-east-1:123456789012:environment/My App/mydestenv"
]
}
]
}
|
Action: | ||
|
|
|
This example allows the {
"Statement": [
{
"Action": [
"elasticbeanstalk:TerminateEnvironment"
],
"Effect": "Allow",
"Resource": [
"arn:aws:elasticbeanstalk:us-east-1:123456789012:environment/My App/myenv"
],
"Condition": {
"StringEquals": {
"elasticbeanstalk:InApplication": ["arn:aws:elasticbeanstalk:us-east-1:123456789012:application/My App"]
}
}
}
]
}
|
Action: UpdateApplication | ||
|
|
N/A |
This example allows the {
"Statement": [
{
"Action": [
"elasticbeanstalk:UpdateApplication"
],
"Effect": "Allow",
"Resource": [
"arn:aws:elasticbeanstalk:us-east-1:123456789012:application/My App"
]
}
]
}
|
Action: | ||
|
|
|
This example allows the {
"Statement": [
{
"Action": [
"elasticbeanstalk:UpdateApplicationVersion"
],
"Effect": "Allow",
"Resource": [
"arn:aws:elasticbeanstalk:us-east-1:123456789012:applicationversion/My App/My Version"
],
"Condition": {
"StringEquals": {
"elasticbeanstalk:InApplication": ["arn:aws:elasticbeanstalk:us-east-1:123456789012:application/My App"]
}
}
}
]
}
|
Action: | ||
|
|
|
This example allows the
{
"Statement": [
{
"Action": [
"elasticbeanstalk:UpdateConfigurationTemplate"
],
"Effect": "Allow",
"Resource": [
"arn:aws:elasticbeanstalk:us-east-1:123456789012:configurationtemplate/My App/My Template"
],
"Condition": {
"StringEquals": {
"elasticbeanstalk:InApplication": ["arn:aws:elasticbeanstalk:us-east-1:123456789012:application/My App"]
}
}
}
]
}
|
Action: | ||
|
|
|
This example allows the {
"Statement": [
{
"Action": [
"elasticbeanstalk:UpdateEnvironment"
],
"Effect": "Allow",
"Resource": [
"arn:aws:elasticbeanstalk:us-east-1:123456789012:environment/My App/myenv"
],
"Condition": {
"StringEquals": {
"elasticbeanstalk:InApplication": ["arn:aws:elasticbeanstalk:us-east-1:123456789012:application/My App"],
"elasticbeanstalk:FromApplicationVersion": ["arn:aws:elasticbeanstalk:us-east-1:123456789012:applicationversion/My App/My Version"]
}
}
}
]
}
|
Action: | ||
|
|
|
This example allows the
{
"Statement": [
{
"Action": [
"elasticbeanstalk:ValidateConfigurationSettings"
],
"Effect": "Allow",
"Resource": [
"arn:aws:elasticbeanstalk:us-east-1:123456789012:environment/My App/myenv"
],
"Condition": {
"StringEquals": {
"elasticbeanstalk:InApplication": ["arn:aws:elasticbeanstalk:us-east-1:123456789012:application/My App"]
}
}
}
]
}
|
Keys enable you to specify conditions that express dependencies, restrict permissions, or specify constraints on the input parameters for an action. AWS Elastic Beanstalk supports the following keys.
InApplicationSpecifies the application that contains the resource that the action operates on.
The following example allows the
UpdateApplicationVersion action to update the
properties of the application version My
Version. The InApplication condition
specifies My App as the container for
My Version.
{
"Statement": [
{
"Action": [
"elasticbeanstalk:UpdateApplicationVersion"
],
"Effect": "Allow",
"Resource": [
"arn:aws:elasticbeanstalk:us-east-1:123456789012:applicationversion/My App/My Version"
],
"Condition": {
"StringEquals": {
"elasticbeanstalk:InApplication": ["arn:aws:elasticbeanstalk:us-east-1:123456789012:application/My App"]
}
}
}
]
}FromApplicationVersionSpecifies an application version as a dependency or a constraint on an input parameter.
The following example allows the UpdateEnvironment
action to update the environment myenv in the
application My App. The
FromApplicationVersion condition constrains the
VersionLabel parameter to allow only the
application version My Version to update the
environment.
{
"Statement": [
{
"Action": [
"elasticbeanstalk:UpdateEnvironment"
],
"Effect": "Allow",
"Resource": [
"arn:aws:elasticbeanstalk:us-east-1:123456789012:environment/My App/myenv"
],
"Condition": {
"StringEquals": {
"elasticbeanstalk:InApplication": ["arn:aws:elasticbeanstalk:us-east-1:123456789012:application/My App"],
"elasticbeanstalk:FromApplicationVersion": ["arn:aws:elasticbeanstalk:us-east-1:123456789012:applicationversion/My App/My Version"]
}
}
}
]
}FromConfigurationTemplateSpecifies a configuration template as a dependency or a constraint on an input parameter.
The following example allows the UpdateEnvironment action
to update the environment myenv in the
application My App. The
FromConfigurationTemplate condition constrains the
TemplateName parameter to allow only the
configuration template My Template to update
the environment.
{
"Statement": [
{
"Action": [
"elasticbeanstalk:UpdateEnvironment"
],
"Effect": "Allow",
"Resource": [
"arn:aws:elasticbeanstalk:us-east-1:123456789012:environment/My App/myenv"
],
"Condition": {
"StringEquals": {
"elasticbeanstalk:InApplication": ["arn:aws:elasticbeanstalk:us-east-1:123456789012:application/My App"],
"elasticbeanstalk:FromConfigurationTemplate": ["arn:aws:elasticbeanstalk:us-east-1:123456789012:configurationtemplate/My App/My Template"]
}
}
}
]
}FromEnvironmentSpecifies an environment as a dependency or a constraint on an input parameter.
The following example allows the
SwapEnvironmentCNAMEs action to swap the CNAMEs in
My App for all environments whose names
begin with mysrcenv and
mydestenv but not those environments
whose names begin with mysrcenvPROD* and
mydestenvPROD*.
{
"Statement": [
{
"Action": [
"elasticbeanstalk:SwapEnvironmentCNAMEs"
],
"Effect": "Allow",
"Resource": [
"arn:aws:elasticbeanstalk:us-east-1:123456789012:environment/My App/mysrcenv*",
"arn:aws:elasticbeanstalk:us-east-1:123456789012:environment/My App/mydestenv*"
],
"Condition": {
"StringNotLike": {
"elasticbeanstalk:FromEnvironment": ["arn:aws:elasticbeanstalk:us-east-1:123456789012:environment/My App/mysrcenvPROD*",
"elasticbeanstalk:FromEnvironment": ["arn:aws:elasticbeanstalk:us-east-1:123456789012:environment/My App/mydestenvPROD*"
]
}
}
}
]
}FromSolutionStackSpecifies a solution stack as a dependency or a constraint on an input parameter.
This example allows the CreateConfigurationTemplate
action to create configuration templates whose name begins with
My Template (My Template*)
in the application My App. The
FromSolutionStack condition constrains the
solutionstack parameter to allow only the solution
stack 32bit Amazon Linux running Tomcat 7 as
the input value for that parameter.
{
"Statement": [
{
"Action": [
"elasticbeanstalk:CreateConfigurationTemplate"
],
"Effect": "Allow",
"Resource": [
"arn:aws:elasticbeanstalk:us-east-1:123456789012:configurationtemplate/My App/My Template*"
],
"Condition": {
"StringEquals": {
"elasticbeanstalk:InApplication": ["arn:aws:elasticbeanstalk:us-east-1:123456789012:application/My App"],
"elasticbeanstalk:FromSolutionStack": ["arn:aws:elasticbeanstalk:us-east-1::solutionstack/32bit Amazon Linux running Tomcat 7"]
}
}
}
]
}