Advertisement
Guest User

Untitled

a guest
Oct 29th, 2017
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.33 KB | None | 0 0
  1. {
  2. "AWSTemplateFormatVersion": "2010-09-09",
  3. "Resources": {
  4. "EC2": {
  5. "Type": "AWS::EC2::Instance",
  6. "Properties": {
  7. "InstanceType": "t2.micro",
  8. "ImageId": "ami-10547475",
  9. "KeyName": "ShardBlade",
  10. "SecurityGroupIds": [
  11. "sg-8ba106e3"
  12. ],
  13. "UserData" : { "Fn::Base64" :
  14. { "Fn::Join" : ["", [
  15. "#!/bin/bash -xe\n",
  16. "# Install the files and packages from the metadata\n",
  17.  
  18. "apt-get --assume-yes install heat-cfntools\n",
  19. "apt-get --assume-yes update\n",
  20. "apt-get --assume-yes install awscli\n",
  21. "apt-get --assume-yes install mono-xsp4\n",
  22.  
  23. "cfn-init ",
  24. " --stack ", { "Ref" : "AWS::StackName" },
  25. " --resource EC2 ",
  26. " --region ", { "Ref" : "AWS::Region" }, "\n"
  27. ]]}
  28. },
  29. "IamInstanceProfile": "InstanceProfile"
  30. },
  31. "Metadata": {
  32. "AWS::CloudFormation::Authentication": {
  33. "S3AccessCreds": {
  34. "type": "S3",
  35. "roleName": "s3access"
  36. }
  37. },
  38. "AWS::CloudFormation::Init": {
  39. "config": {
  40. "files": {
  41. "/tmp/test-file": {
  42. "source": "https://s3.us-east-2.amazonaws.com/sashoalm-bucket/test-file",
  43. "authentication": "S3AccessCreds"
  44. }
  45. }
  46. }
  47. }
  48. }
  49. },
  50. "InstanceProfile": {
  51. "Type": "AWS::IAM::InstanceProfile",
  52. "Properties": {
  53. "Roles": [ "s3access" ],
  54. "InstanceProfileName": "InstanceProfile"
  55. }
  56. }
  57. },
  58. "Outputs": {
  59. "EC2IP": {
  60. "Description": "The IP of the EC2 instance",
  61. "Value": { "Fn::GetAtt": [ "EC2", "PublicIp" ] }
  62. }
  63. }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement