Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "AWSTemplateFormatVersion": "2010-09-09",
- "Resources": {
- "EC2": {
- "Type": "AWS::EC2::Instance",
- "Properties": {
- "InstanceType": "t2.micro",
- "ImageId": "ami-10547475",
- "KeyName": "ShardBlade",
- "SecurityGroupIds": [
- "sg-8ba106e3"
- ],
- "UserData" : { "Fn::Base64" :
- { "Fn::Join" : ["", [
- "#!/bin/bash -xe\n",
- "# Install the files and packages from the metadata\n",
- "apt-get --assume-yes install heat-cfntools\n",
- "apt-get --assume-yes update\n",
- "apt-get --assume-yes install awscli\n",
- "apt-get --assume-yes install mono-xsp4\n",
- "cfn-init ",
- " --stack ", { "Ref" : "AWS::StackName" },
- " --resource EC2 ",
- " --region ", { "Ref" : "AWS::Region" }, "\n"
- ]]}
- },
- "IamInstanceProfile": "InstanceProfile"
- },
- "Metadata": {
- "AWS::CloudFormation::Authentication": {
- "S3AccessCreds": {
- "type": "S3",
- "roleName": "s3access"
- }
- },
- "AWS::CloudFormation::Init": {
- "config": {
- "files": {
- "/tmp/test-file": {
- "source": "https://s3.us-east-2.amazonaws.com/sashoalm-bucket/test-file",
- "authentication": "S3AccessCreds"
- }
- }
- }
- }
- }
- },
- "InstanceProfile": {
- "Type": "AWS::IAM::InstanceProfile",
- "Properties": {
- "Roles": [ "s3access" ],
- "InstanceProfileName": "InstanceProfile"
- }
- }
- },
- "Outputs": {
- "EC2IP": {
- "Description": "The IP of the EC2 instance",
- "Value": { "Fn::GetAtt": [ "EC2", "PublicIp" ] }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement