Skip to content

Instantly share code, notes, and snippets.

@hasantayyar
Forked from magnetikonline/README.md
Created June 1, 2018 16:17
Show Gist options
  • Save hasantayyar/321a31135a2d930e54f94d982a7ac7c7 to your computer and use it in GitHub Desktop.
Save hasantayyar/321a31135a2d930e54f94d982a7ac7c7 to your computer and use it in GitHub Desktop.

Revisions

  1. @magnetikonline magnetikonline revised this gist Jan 18, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -76,7 +76,7 @@ Where:

    ## Notes:
    - The addition of the `s3:CreateBucket` action against the `arn:aws:s3:::elasticbeanstalk-REGION-ACCOUNT_ID` resource is **critical** for the creation of new Elastic Beanstalk application instances - even if the _bucket itself already exists_.
    - Policy is designed to work with [single container Docker environments](http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/docker-singlecontainer-deploy.html), but will not support multicontainer - which requires additional ECS action permissions.
    - Policy has been designed to work with [single container Docker environments](http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/docker-singlecontainer-deploy.html) - not multicontainer, which are ECS cluster environments under the hood and requires additional IAM action permissions.

    ## Reference
    - http://nudaygames.squarespace.com/blog/2014/5/26/deploying-to-elastic-beanstalk-from-your-continuous-integration-system
  2. @magnetikonline magnetikonline revised this gist Oct 4, 2015. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -74,7 +74,9 @@ Where:
    }
    ```

    **Note:** the addition of `s3:CreateBucket` against `arn:aws:s3:::elasticbeanstalk-REGION-ACCOUNT_ID` is **critical** for the creation of new Elastic Beanstalk application instances - even if the bucket itself already exists.
    ## Notes:
    - The addition of the `s3:CreateBucket` action against the `arn:aws:s3:::elasticbeanstalk-REGION-ACCOUNT_ID` resource is **critical** for the creation of new Elastic Beanstalk application instances - even if the _bucket itself already exists_.
    - Policy is designed to work with [single container Docker environments](http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/docker-singlecontainer-deploy.html), but will not support multicontainer - which requires additional ECS action permissions.

    ## Reference
    - http://nudaygames.squarespace.com/blog/2014/5/26/deploying-to-elastic-beanstalk-from-your-continuous-integration-system
  3. @magnetikonline magnetikonline revised this gist Jun 3, 2015. 1 changed file with 5 additions and 2 deletions.
    7 changes: 5 additions & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -28,11 +28,11 @@ Where:
    ],
    "Effect": "Allow",
    "Resource": [
    "arn:aws:elasticbeanstalk:*::solutionstack/*",
    "arn:aws:elasticbeanstalk:REGION:ACCOUNT_ID:application/APPLICATION_NAME",
    "arn:aws:elasticbeanstalk:REGION:ACCOUNT_ID:applicationversion/APPLICATION_NAME/*",
    "arn:aws:elasticbeanstalk:REGION:ACCOUNT_ID:environment/APPLICATION_NAME/*",
    "arn:aws:elasticbeanstalk:REGION:ACCOUNT_ID:template/APPLICATION_NAME/*",
    "arn:aws:elasticbeanstalk:*::solutionstack/*"
    "arn:aws:elasticbeanstalk:REGION:ACCOUNT_ID:template/APPLICATION_NAME/*"
    ]
    },
    {
    @@ -46,6 +46,7 @@ Where:
    },
    {
    "Action": [
    "s3:CreateBucket",
    "s3:DeleteObject",
    "s3:GetBucketPolicy",
    "s3:GetObjectAcl",
    @@ -73,5 +74,7 @@ Where:
    }
    ```

    **Note:** the addition of `s3:CreateBucket` against `arn:aws:s3:::elasticbeanstalk-REGION-ACCOUNT_ID` is **critical** for the creation of new Elastic Beanstalk application instances - even if the bucket itself already exists.

    ## Reference
    - http://nudaygames.squarespace.com/blog/2014/5/26/deploying-to-elastic-beanstalk-from-your-continuous-integration-system
  4. @magnetikonline magnetikonline revised this gist Jun 2, 2015. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -50,6 +50,7 @@ Where:
    "s3:GetBucketPolicy",
    "s3:GetObjectAcl",
    "s3:ListBucket",
    "s3:PutBucketPolicy",
    "s3:PutObject",
    "s3:PutObjectAcl"
    ],
  5. @magnetikonline magnetikonline revised this gist Jun 2, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -32,7 +32,7 @@ Where:
    "arn:aws:elasticbeanstalk:REGION:ACCOUNT_ID:applicationversion/APPLICATION_NAME/*",
    "arn:aws:elasticbeanstalk:REGION:ACCOUNT_ID:environment/APPLICATION_NAME/*",
    "arn:aws:elasticbeanstalk:REGION:ACCOUNT_ID:template/APPLICATION_NAME/*",
    "arn:aws:elasticbeanstalk:REGION::solutionstack/*"
    "arn:aws:elasticbeanstalk:*::solutionstack/*"
    ]
    },
    {
  6. @magnetikonline magnetikonline revised this gist Jun 2, 2015. 1 changed file with 5 additions and 2 deletions.
    7 changes: 5 additions & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -31,8 +31,8 @@ Where:
    "arn:aws:elasticbeanstalk:REGION:ACCOUNT_ID:application/APPLICATION_NAME",
    "arn:aws:elasticbeanstalk:REGION:ACCOUNT_ID:applicationversion/APPLICATION_NAME/*",
    "arn:aws:elasticbeanstalk:REGION:ACCOUNT_ID:environment/APPLICATION_NAME/*",
    "arn:aws:elasticbeanstalk:REGION:ACCOUNT_ID:solutionstack/*",
    "arn:aws:elasticbeanstalk:REGION:ACCOUNT_ID:template/APPLICATION_NAME/*"
    "arn:aws:elasticbeanstalk:REGION:ACCOUNT_ID:template/APPLICATION_NAME/*",
    "arn:aws:elasticbeanstalk:REGION::solutionstack/*"
    ]
    },
    {
    @@ -71,3 +71,6 @@ Where:
    ]
    }
    ```

    ## Reference
    - http://nudaygames.squarespace.com/blog/2014/5/26/deploying-to-elastic-beanstalk-from-your-continuous-integration-system
  7. @magnetikonline magnetikonline created this gist May 21, 2015.
    73 changes: 73 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,73 @@
    # AWS Elastic Beanstalk deploy user restricted IAM policy
    An IAM user policy document to give minimal rights for deploying an Elastic Beanstalk application.

    Where:
    - `REGION`: AWS region.
    - `ACCOUNT_ID`: AWS account ID.
    - `APPLICATION_NAME`: Desired target Elastic Beanstalk application name(space).
    - `IAM_INSTANCE_PROFILE_ROLE`: The instance profile (IAM role) Elastic Beanstalk EC2 instaces will run under.

    ```json
    {
    "Version": "2012-10-17",
    "Statement": [
    {
    "Action": [
    "autoscaling:*",
    "cloudformation:*",
    "ec2:*"
    ],
    "Effect": "Allow",
    "Resource": [
    "*"
    ]
    },
    {
    "Action": [
    "elasticbeanstalk:*"
    ],
    "Effect": "Allow",
    "Resource": [
    "arn:aws:elasticbeanstalk:REGION:ACCOUNT_ID:application/APPLICATION_NAME",
    "arn:aws:elasticbeanstalk:REGION:ACCOUNT_ID:applicationversion/APPLICATION_NAME/*",
    "arn:aws:elasticbeanstalk:REGION:ACCOUNT_ID:environment/APPLICATION_NAME/*",
    "arn:aws:elasticbeanstalk:REGION:ACCOUNT_ID:solutionstack/*",
    "arn:aws:elasticbeanstalk:REGION:ACCOUNT_ID:template/APPLICATION_NAME/*"
    ]
    },
    {
    "Action": [
    "s3:GetObject"
    ],
    "Effect": "Allow",
    "Resource": [
    "arn:aws:s3:::elasticbeanstalk-*/*"
    ]
    },
    {
    "Action": [
    "s3:DeleteObject",
    "s3:GetBucketPolicy",
    "s3:GetObjectAcl",
    "s3:ListBucket",
    "s3:PutObject",
    "s3:PutObjectAcl"
    ],
    "Effect": "Allow",
    "Resource": [
    "arn:aws:s3:::elasticbeanstalk-REGION-ACCOUNT_ID",
    "arn:aws:s3:::elasticbeanstalk-REGION-ACCOUNT_ID/*"
    ]
    },
    {
    "Action": [
    "iam:PassRole"
    ],
    "Effect": "Allow",
    "Resource": [
    "arn:aws:iam::ACCOUNT_ID:role/IAM_INSTANCE_PROFILE_ROLE"
    ]
    }
    ]
    }
    ```