User data | EC2 - AWS CloudFormation p2.7



Welcome to part 2.7 of this tutorial series on AWS CloudFormation. In this tutorial, I have covered user data (EC2) with cloud formation.


Support my work:

Patreon: https://www.patreon.com/srcecde
PayPal: https://paypal.me/srcecde
Paytm | Gpay: 9023197426


Series Tutorial


Another channel:

Srce Cde in Hindi: https://www.youtube.com/channel/UCooUM00QHpzDEcfkNGRm0Ag


Connect with me

Twitter: https://twitter.com/srcecde
GitHub: https://github.com/srcecde
Facebook: https://www.facebook.com/SrceCde/
Instagram: https://www.instagram.com/srcecde/
LinkedIn: https://www.linkedin.com/company/srcecde/
Reddit: https://www.reddit.com/r/srcecde

source

2 thoughts on “User data | EC2 – AWS CloudFormation p2.7”
  1. @Srce Cde mate I think the code you have used in this presentation no where you have mentioned the code for SSH. I have followed your video and can't do. Could you please follow up. Thank you and appreciate
    This is the code you have used:
    ========================================================
    sshAWSTemplateFormatVersion: "2010-09-09"

    Description: "Create EC2 Instance"

    Parameters:

    InstanceTypeParameter:

    Description: Select instance type # Optional

    Type: String

    Default: t2.micro

    AllowedValues: # User will get dropdown to select the below options

    – t2.micro

    – m1.small

    – m1.large

    Description: Enter t2.micro, m1.small or m1.large. Default is t2.micro. # Optional

    Resources:

    Instance: # Logical ID/Name

    Type: AWS::EC2::Instance # Type

    Properties:

    InstanceType: !Ref InstanceTypeParameter

    ImageId: ami-04a81599b183d7908

    KeyName: flask

    UserData:

    Fn::Base64:

    !Sub |

    #!/bin/bash

    apt-get update -y

    apt-get install docker-compose -y

    mkdir /home/ubuntu/sample

    Outputs:

    Instance:

    Description: EC2 Instance has successfully created!

    Value: !Ref InstanceTypeParameter

Leave a Reply

Your email address will not be published.

Captcha loading...