I am starting to learn/work with AWS and Cloudformation, I have this:
Type: 'AWS::EC2::Instance'
Properties:
SecurityGroupIds:
- !Ref InstanceSecurityGroup
SubnetId:
!Ref "PublicSubnet1"
IamInstanceProfile:
!Ref RootInstanceProfile
ImageId: ami-02cb52d7ba9887a93
InstanceType: t3.micro
UserData:
Fn::Base64: !Sub |
#!/bin/bash
# Install Apache Web Server and PHP
yum install -y httpd mysql
amazon-linux-extras install -y php7.2
# Download Lab files
wget https://us-west-2-tcprod.s3.amazonaws.com/courses/ILT-TF-100-ARCHIT/v6.5.0/lab-2-webapp/scripts/inventory-app.zip
unzip inventory-app.zip -d /var/www/html/
# Download and install the AWS SDK for PHP
wget https://github.com/aws/aws-sdk-php/releases/download/3.62.3/aws.zip
unzip aws -d /var/www/html
# Turn on web server
chkconfig httpd on
service httpd start
When I try to create the stack I receive an identention error at UserData:
Any advice or tip?
Thank you so much for your help
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…