Example #1
0
                    CoreInstanceGroup=emr.InstanceGroupConfigProperty(
                        Name="Core Instance",
                        BidPrice="20",
                        InstanceCount="1",
                        InstanceType="m3.xlarge",
                        Market="SPOT")),
                Applications=[
                    emr.Application(Name="Hadoop"),
                    emr.Application(Name="Hive"),
                    emr.Application(Name="Mahout"),
                    emr.Application(Name="Pig"),
                    emr.Application(Name="Spark")
                ],
                VisibleToAllUsers="true",
                Tags=Tags(Name="EMR Sample Cluster")))

step = template.add_resource(
    emr.Step('TestStep',
             Name="TestStep",
             ActionOnFailure='CONTINUE',
             HadoopJarStep=emr.HadoopJarStepConfig(
                 Args=["5", "10"],
                 Jar="s3://emr-cfn-test/hadoop-mapreduce-examples-2.6.0.jar",
                 MainClass="pi",
                 StepProperties=[
                     emr.KeyValue('my.custom.property', 'my.custom.value')
                 ]),
             JobFlowId=Ref(cluster)))

print(template.to_json())
Example #2
0
            ),
        ),
        Applications=[
            emr.Application(Name="Hadoop"),
            emr.Application(Name="Hive"),
            emr.Application(Name="Mahout"),
            emr.Application(Name="Pig"),
            emr.Application(Name="Spark"),
        ],
        VisibleToAllUsers="true",
        Tags=Tags(Name="EMR Sample Cluster"),
    ))

step = template.add_resource(
    emr.Step(
        "TestStep",
        Name="TestStep",
        ActionOnFailure="CONTINUE",
        HadoopJarStep=emr.HadoopJarStepConfig(
            Args=["5", "10"],
            Jar="s3://emr-cfn-test/hadoop-mapreduce-examples-2.6.0.jar",
            MainClass="pi",
            StepProperties=[
                emr.KeyValue("my.custom.property", "my.custom.value")
            ],
        ),
        JobFlowId=Ref(cluster),
    ))

print(template.to_json())