Created
September 4, 2022 18:39
-
-
Save BielosX/411fdb0f4c87f6177584c183993dfc8c to your computer and use it in GitHub Desktop.
AWS Beanstalk using CloudFormation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Parameters: | |
SolutionStackName: | |
Type: String | |
Resources: | |
DemoBucket: | |
Type: AWS::S3::Bucket | |
Properties: | |
BucketName: !Sub "demo-app-bucket-${AWS::Region}-${AWS::AccountId}" | |
AccessControl: "Private" | |
DemoApplication: | |
Type: AWS::ElasticBeanstalk::Application | |
Properties: | |
ApplicationName: "demo-app" | |
AppIamRole: | |
Type: AWS::IAM::Role | |
Properties: | |
AssumeRolePolicyDocument: | |
Version: "2012-10-17" | |
Statement: | |
- Effect: Allow | |
Principal: | |
Service: | |
- ec2.amazonaws.com | |
Action: | |
- 'sts:AssumeRole' | |
ManagedPolicyArns: | |
- "arn:aws:iam::aws:policy/AWSElasticBeanstalkWebTier" | |
AppInstanceProfile: | |
Type: AWS::IAM::InstanceProfile | |
Properties: | |
Roles: | |
- !Ref AppIamRole | |
DemoEnv: | |
Type: AWS::ElasticBeanstalk::Environment | |
Properties: | |
ApplicationName: !Ref DemoApplication | |
EnvironmentName: "demo-app-env" | |
SolutionStackName: !Ref SolutionStackName | |
OptionSettings: | |
- Namespace: "aws:autoscaling:launchconfiguration" | |
OptionName: "InstanceType" | |
Value: "t3.micro" | |
- Namespace: "aws:autoscaling:launchconfiguration" | |
OptionName: "IamInstanceProfile" | |
Value: !Ref AppInstanceProfile | |
- Namespace: "aws:elasticbeanstalk:healthreporting:system" | |
OptionName: "SystemType" | |
Value: "enhanced" | |
- Namespace: "aws:elasticbeanstalk:cloudwatch:logs" | |
OptionName: "StreamLogs" | |
Value: true | |
- Namespace: "aws:elasticbeanstalk:cloudwatch:logs" | |
OptionName: "DeleteOnTerminate" | |
Value: true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment