AWS CLoudformation Help

Discussion in 'Simplilearn Support' started by _37181, Oct 2, 2018.

  1. _37181

    _37181 Member

    Joined:
    Aug 10, 2018
    Messages:
    2
    Likes Received:
    0
    Hello,

    Requirement
    1) Create cloudformation stack
    2) Create EMR cluster
    3) Place EC2 instance under EMR
    4) run Boot strapping
    5) Terminate EMR cluster
    6) Delete CLoudformation stack

    I have created below Jason, but no idea about terminating EMR and deleting stack after deployment.

    {
    "AWSTemplateFormatVersion": "2010-09-09",
    "Metadata": {
    "AWS::CloudFormation::Designer": {
    "f9d6d6f2-7bd6-4551-93c2-4b1644e63099?": {
    "size": {
    "width": 60,
    "height": 60
    },
    "position": {
    "x": 60,
    "y": 90
    },
    "z": 1,
    "embeds": []
    }
    }
    },
    "Parameters": {
    "DeploymentTarget": {
    "Description": "Choose deployment target from list",
    "Type": "String",
    "AllowedValues": [
    "CEMP-TEST-EMR-QA-EAST",
    "CEMP-RESULTS-EC2-QA-EAST",
    "CEMP-RESULTS-EC2-QA-WEST",
    "CEMP-RESULTS-EC2-PROD-EAST",
    "CEMP-RESULTS-EC2-PROD-WEST"
    ]
    },
    "AMIVersion": {
    "Description": "Latest AMI Version for RHEL7",
    "Type": "String"
    }
    },
    "Resources": {
    "EMRC21MM701": {
    "Type": "AWS::EMR::Cluster",
    "Properties": {
    "Instances": {
    "MasterInstanceGroup": {
    "InstanceCount": 1,
    "InstanceType": "m4.large",
    "Market": "ON_DEMAND",
    "Name": "cemp-emr-dev-master"
    },
    "CoreInstanceGroup": {
    "InstanceCount": 1,
    "InstanceType": "m4.large",
    "Market": "ON_DEMAND",
    "Name": "cemp-emr-core"
    },
    "TerminationProtected": false,
    "Ec2SubnetId": "subnet-3168011a",
    "EmrManagedMasterSecurityGroup": "sg-f356cf8f",
    "EmrManagedSlaveSecurityGroup": "sg-ed56cf91",
    "ServiceAccessSecurityGroup": "sg-b056cfcc",
    "AdditionalMasterSecurityGroups": [
    "sg-80cd92e4",
    "sg-f3b7298d",
    "sg-fe7f7d86"
    ],
    "AdditionalSlaveSecurityGroups": [
    "sg-80cd92e4",
    "sg-f3b7298d",
    "sg-fe7f7d86"
    ]
    },
    "BootstrapActions": [
    {
    "Name": "cof-emr-bootstrap",
    "ScriptBootstrapAction": {
    "Path": "s3://cof-emr-bootstrap/emr/bootstrap.sh"
    }
    },
    {
    "Name": "Vortex Setup",
    "ScriptBootstrapAction": {
    "Path": "s3://cemp-dev/Drill/emr/cemp-emr-bootstrap.sh"
    }
    }
    ],
    "AdditionalInfo": {
    "hadoopConfigurationVersion": "4.0",
    "instanceAwsClientConfiguration": {
    "proxyPort": 8099,
    "proxyHost": "aws-proxy-dev.cloud.capitalone.com"
    }
    },
    "Applications": [
    {
    "Name": "Hadoop"
    },
    {
    "Name": "Spark"
    }
    ],
    "Name": "cemp-emr-dev-vortex",
    "JobFlowRole": "CapOne-SPR-CEMP-DATA-DELIVERY-QA",
    "ScaleDownBehavior": "TERMINATE_AT_TASK_COMPLETION",
    "ServiceRole": "EMR_DefaultRole",
    "AutoScalingRole": "EMR_AutoScaling_DefaultRole",
    "SecurityConfiguration": "COF-Encrypted",
    "ReleaseLabel": "emr-5.12.1",
    "CustomAmiId": "ami-2d7a5652",
    "LogUri": "s3n://cemp-dev/Drill/emr/logs/",
    "VisibleToAllUsers": true,
    "Tags": [
    {
    "Key": "ASV",
    "Value": "ASVCEMPDATADELIVERY"
    },
    {
    "Key": "OwnerContact",
    "Value": "GSC249"
    },
    {
    "Key": "CMDBEnvironment",
    "Value": "ENVNPCEMPDATADELIVERY"
    }
    ]
    },
    "TestSTEP": {
    "Type": "AWS::EMR::Step",
    "Properties": {
    "ActionOnFailure": "TERMINATE_CLUSTER",
    "HadoopJarStep": {
    "Args": [
    "5",
    "10"
    ],
    "Jar": "s3://s3.ap-south-1.amazonaws.com/arunsv.com/Arun.jar.txt"
    "MainClass": "pi"
    },
    "Name": "JaveedSTEP",
    "JobFlowId": {
    "Ref": "EMRC21MM701"
    }
    }
    },
    "Metadata": {
    "AWS::CloudFormation::Designer": {
    "id": "f9d6d6f2-7bd6-4551-93c2-4b1644e63099?"
    }
    }
    }
    }
    }
     
    #1
  2. Prajakta_8

    Prajakta_8 Well-Known Member
    Simplilearn Support

    Joined:
    Apr 25, 2018
    Messages:
    70
    Likes Received:
    1
    Hi Learner, we do not have any such reqirement in any of our AWS projects. Do let me know if I am missing something.
     
    #2

Share This Page