/
cluster.go
1011 lines (951 loc) · 58.4 KB
/
cluster.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package emr
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// Provides an Elastic MapReduce Cluster, a web service that makes it easy to
// process large amounts of data efficiently. See [Amazon Elastic MapReduce Documentation](https://aws.amazon.com/documentation/elastic-mapreduce/)
// for more information.
//
// To configure [Instance Groups](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-instance-group-configuration.html#emr-plan-instance-groups) for [task nodes](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-master-core-task-nodes.html#emr-plan-task), see the `emr.InstanceGroup` resource.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "fmt"
//
// "github.com/pulumi/pulumi-aws/sdk/v3/go/aws/emr"
// "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := emr.NewCluster(ctx, "cluster", &emr.ClusterArgs{
// ReleaseLabel: pulumi.String("emr-4.6.0"),
// Applications: pulumi.StringArray{
// pulumi.String("Spark"),
// },
// AdditionalInfo: pulumi.String(fmt.Sprintf("%v%v%v%v%v%v", "{\n", " \"instanceAwsClientConfiguration\": {\n", " \"proxyPort\": 8099,\n", " \"proxyHost\": \"myproxy.example.com\"\n", " }\n", "}\n")),
// TerminationProtection: pulumi.Bool(false),
// KeepJobFlowAliveWhenNoSteps: pulumi.Bool(true),
// Ec2Attributes: &emr.ClusterEc2AttributesArgs{
// SubnetId: pulumi.Any(aws_subnet.Main.Id),
// EmrManagedMasterSecurityGroup: pulumi.Any(aws_security_group.Sg.Id),
// EmrManagedSlaveSecurityGroup: pulumi.Any(aws_security_group.Sg.Id),
// InstanceProfile: pulumi.Any(aws_iam_instance_profile.Emr_profile.Arn),
// },
// MasterInstanceGroup: &emr.ClusterMasterInstanceGroupArgs{
// InstanceType: pulumi.String("m4.large"),
// },
// CoreInstanceGroup: &emr.ClusterCoreInstanceGroupArgs{
// InstanceType: pulumi.String("c4.large"),
// InstanceCount: pulumi.Int(1),
// EbsConfigs: emr.ClusterCoreInstanceGroupEbsConfigArray{
// &emr.ClusterCoreInstanceGroupEbsConfigArgs{
// Size: pulumi.Int(40),
// Type: pulumi.String("gp2"),
// VolumesPerInstance: pulumi.Int(1),
// },
// },
// BidPrice: pulumi.String("0.30"),
// AutoscalingPolicy: pulumi.String(fmt.Sprintf("%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v", "{\n", "\"Constraints\": {\n", " \"MinCapacity\": 1,\n", " \"MaxCapacity\": 2\n", "},\n", "\"Rules\": [\n", " {\n", " \"Name\": \"ScaleOutMemoryPercentage\",\n", " \"Description\": \"Scale out if YARNMemoryAvailablePercentage is less than 15\",\n", " \"Action\": {\n", " \"SimpleScalingPolicyConfiguration\": {\n", " \"AdjustmentType\": \"CHANGE_IN_CAPACITY\",\n", " \"ScalingAdjustment\": 1,\n", " \"CoolDown\": 300\n", " }\n", " },\n", " \"Trigger\": {\n", " \"CloudWatchAlarmDefinition\": {\n", " \"ComparisonOperator\": \"LESS_THAN\",\n", " \"EvaluationPeriods\": 1,\n", " \"MetricName\": \"YARNMemoryAvailablePercentage\",\n", " \"Namespace\": \"AWS/ElasticMapReduce\",\n", " \"Period\": 300,\n", " \"Statistic\": \"AVERAGE\",\n", " \"Threshold\": 15.0,\n", " \"Unit\": \"PERCENT\"\n", " }\n", " }\n", " }\n", "]\n", "}\n")),
// },
// EbsRootVolumeSize: pulumi.Int(100),
// Tags: pulumi.StringMap{
// "role": pulumi.String("rolename"),
// "env": pulumi.String("env"),
// },
// BootstrapActions: emr.ClusterBootstrapActionArray{
// &emr.ClusterBootstrapActionArgs{
// Path: pulumi.String("s3://elasticmapreduce/bootstrap-actions/run-if"),
// Name: pulumi.String("runif"),
// Args: pulumi.StringArray{
// pulumi.String("instance.isMaster=true"),
// pulumi.String("echo running on master node"),
// },
// },
// },
// ConfigurationsJson: pulumi.String(fmt.Sprintf("%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v", " [\n", " {\n", " \"Classification\": \"hadoop-env\",\n", " \"Configurations\": [\n", " {\n", " \"Classification\": \"export\",\n", " \"Properties\": {\n", " \"JAVA_HOME\": \"/usr/lib/jvm/java-1.8.0\"\n", " }\n", " }\n", " ],\n", " \"Properties\": {}\n", " },\n", " {\n", " \"Classification\": \"spark-env\",\n", " \"Configurations\": [\n", " {\n", " \"Classification\": \"export\",\n", " \"Properties\": {\n", " \"JAVA_HOME\": \"/usr/lib/jvm/java-1.8.0\"\n", " }\n", " }\n", " ],\n", " \"Properties\": {}\n", " }\n", " ]\n")),
// ServiceRole: pulumi.Any(aws_iam_role.Iam_emr_service_role.Arn),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// The `emr.Cluster` resource typically requires two IAM roles, one for the EMR Cluster
// to use as a service, and another to place on your Cluster Instances to interact
// with AWS from those instances. The suggested role policy template for the EMR service is `AmazonElasticMapReduceRole`,
// and `AmazonElasticMapReduceforEC2Role` for the EC2 profile. See the [Getting
// Started](https://docs.aws.amazon.com/ElasticMapReduce/latest/ManagementGuide/emr-gs-launch-sample-cluster.html)
// guide for more information on these IAM roles. There is also a fully-bootable
// example this provider configuration at the bottom of this page.
// ## Instance Fleet
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-aws/sdk/v3/go/aws/emr"
// "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := emr.NewCluster(ctx, "example", &emr.ClusterArgs{
// MasterInstanceFleet: &emr.ClusterMasterInstanceFleetArgs{
// InstanceTypeConfigs: emr.ClusterMasterInstanceFleetInstanceTypeConfigArray{
// &emr.ClusterMasterInstanceFleetInstanceTypeConfigArgs{
// InstanceType: pulumi.String("m4.xlarge"),
// },
// },
// TargetOnDemandCapacity: pulumi.Int(1),
// },
// CoreInstanceFleet: &emr.ClusterCoreInstanceFleetArgs{
// InstanceTypeConfigs: emr.ClusterCoreInstanceFleetInstanceTypeConfigArray{
// &emr.ClusterCoreInstanceFleetInstanceTypeConfigArgs{
// BidPriceAsPercentageOfOnDemandPrice: pulumi.Float64(80),
// EbsConfigs: emr.ClusterCoreInstanceFleetInstanceTypeConfigEbsConfigArray{
// &emr.ClusterCoreInstanceFleetInstanceTypeConfigEbsConfigArgs{
// Size: pulumi.Int(100),
// Type: pulumi.String("gp2"),
// VolumesPerInstance: pulumi.Int(1),
// },
// },
// InstanceType: pulumi.String("m3.xlarge"),
// WeightedCapacity: pulumi.Int(1),
// },
// &emr.ClusterCoreInstanceFleetInstanceTypeConfigArgs{
// BidPriceAsPercentageOfOnDemandPrice: pulumi.Float64(100),
// EbsConfigs: emr.ClusterCoreInstanceFleetInstanceTypeConfigEbsConfigArray{
// &emr.ClusterCoreInstanceFleetInstanceTypeConfigEbsConfigArgs{
// Size: pulumi.Int(100),
// Type: pulumi.String("gp2"),
// VolumesPerInstance: pulumi.Int(1),
// },
// },
// InstanceType: pulumi.String("m4.xlarge"),
// WeightedCapacity: pulumi.Int(1),
// },
// &emr.ClusterCoreInstanceFleetInstanceTypeConfigArgs{
// BidPriceAsPercentageOfOnDemandPrice: pulumi.Float64(100),
// EbsConfigs: emr.ClusterCoreInstanceFleetInstanceTypeConfigEbsConfigArray{
// &emr.ClusterCoreInstanceFleetInstanceTypeConfigEbsConfigArgs{
// Size: pulumi.Int(100),
// Type: pulumi.String("gp2"),
// VolumesPerInstance: pulumi.Int(1),
// },
// },
// InstanceType: pulumi.String("m4.2xlarge"),
// WeightedCapacity: pulumi.Int(2),
// },
// },
// LaunchSpecifications: &emr.ClusterCoreInstanceFleetLaunchSpecificationsArgs{
// SpotSpecifications: emr.ClusterCoreInstanceFleetLaunchSpecificationsSpotSpecificationArray{
// &emr.ClusterCoreInstanceFleetLaunchSpecificationsSpotSpecificationArgs{
// AllocationStrategy: pulumi.String("capacity-optimized"),
// BlockDurationMinutes: pulumi.Int(0),
// TimeoutAction: pulumi.String("SWITCH_TO_ON_DEMAND"),
// TimeoutDurationMinutes: pulumi.Int(10),
// },
// },
// },
// Name: pulumi.String("core fleet"),
// TargetOnDemandCapacity: pulumi.Int(2),
// TargetSpotCapacity: pulumi.Int(2),
// },
// })
// if err != nil {
// return err
// }
// _, err = emr.NewInstanceFleet(ctx, "task", &emr.InstanceFleetArgs{
// ClusterId: example.ID(),
// InstanceTypeConfigs: emr.InstanceFleetInstanceTypeConfigArray{
// &emr.InstanceFleetInstanceTypeConfigArgs{
// BidPriceAsPercentageOfOnDemandPrice: pulumi.Float64(100),
// EbsConfigs: emr.InstanceFleetInstanceTypeConfigEbsConfigArray{
// &emr.InstanceFleetInstanceTypeConfigEbsConfigArgs{
// Size: pulumi.Int(100),
// Type: pulumi.String("gp2"),
// VolumesPerInstance: pulumi.Int(1),
// },
// },
// InstanceType: pulumi.String("m4.xlarge"),
// WeightedCapacity: pulumi.Int(1),
// },
// &emr.InstanceFleetInstanceTypeConfigArgs{
// BidPriceAsPercentageOfOnDemandPrice: pulumi.Float64(100),
// EbsConfigs: emr.InstanceFleetInstanceTypeConfigEbsConfigArray{
// &emr.InstanceFleetInstanceTypeConfigEbsConfigArgs{
// Size: pulumi.Int(100),
// Type: pulumi.String("gp2"),
// VolumesPerInstance: pulumi.Int(1),
// },
// },
// InstanceType: pulumi.String("m4.2xlarge"),
// WeightedCapacity: pulumi.Int(2),
// },
// },
// LaunchSpecifications: &emr.InstanceFleetLaunchSpecificationsArgs{
// SpotSpecifications: emr.InstanceFleetLaunchSpecificationsSpotSpecificationArray{
// &emr.InstanceFleetLaunchSpecificationsSpotSpecificationArgs{
// AllocationStrategy: pulumi.String("capacity-optimized"),
// BlockDurationMinutes: pulumi.Int(0),
// TimeoutAction: pulumi.String("TERMINATE_CLUSTER"),
// TimeoutDurationMinutes: pulumi.Int(10),
// },
// },
// },
// TargetOnDemandCapacity: pulumi.Int(1),
// TargetSpotCapacity: pulumi.Int(1),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// ### Enable Debug Logging
//
// [Debug logging in EMR](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-plan-debugging.html)
// is implemented as a step. It is highly recommended to utilize [`ignoreChanges`](https://www.pulumi.com/docs/intro/concepts/programming-model/#ignorechanges) if other
// steps are being managed outside of this provider.
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-aws/sdk/v3/go/aws/emr"
// "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := emr.NewCluster(ctx, "example", &emr.ClusterArgs{
// Steps: emr.ClusterStepArray{
// &emr.ClusterStepArgs{
// ActionOnFailure: pulumi.String("TERMINATE_CLUSTER"),
// Name: pulumi.String("Setup Hadoop Debugging"),
// HadoopJarStep: &emr.ClusterStepHadoopJarStepArgs{
// Jar: pulumi.String("command-runner.jar"),
// Args: pulumi.StringArray{
// pulumi.String("state-pusher-script"),
// },
// },
// },
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// ### Multiple Node Master Instance Group
//
// Available in EMR version 5.23.0 and later, an EMR Cluster can be launched with three master nodes for high availability. Additional information about this functionality and its requirements can be found in the [EMR Management Guide](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-plan-ha.html).
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-aws/sdk/v3/go/aws/ec2"
// "github.com/pulumi/pulumi-aws/sdk/v3/go/aws/emr"
// "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// exampleSubnet, err := ec2.NewSubnet(ctx, "exampleSubnet", &ec2.SubnetArgs{
// MapPublicIpOnLaunch: pulumi.Bool(true),
// })
// if err != nil {
// return err
// }
// _, err = emr.NewCluster(ctx, "exampleCluster", &emr.ClusterArgs{
// ReleaseLabel: pulumi.String("emr-5.24.1"),
// TerminationProtection: pulumi.Bool(true),
// Ec2Attributes: &emr.ClusterEc2AttributesArgs{
// SubnetId: exampleSubnet.ID(),
// },
// MasterInstanceGroup: &emr.ClusterMasterInstanceGroupArgs{
// InstanceCount: pulumi.Int(3),
// },
// CoreInstanceGroup: nil,
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// ## Example bootable config
//
// **NOTE:** This configuration demonstrates a minimal configuration needed to
// boot an example EMR Cluster. It is not meant to display best practices. Please
// use at your own risk.
//
// ```go
// package main
//
// import (
// "fmt"
//
// "github.com/pulumi/pulumi-aws/sdk/v3/go/aws/ec2"
// "github.com/pulumi/pulumi-aws/sdk/v3/go/aws/emr"
// "github.com/pulumi/pulumi-aws/sdk/v3/go/aws/iam"
// "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// mainVpc, err := ec2.NewVpc(ctx, "mainVpc", &ec2.VpcArgs{
// CidrBlock: pulumi.String("168.31.0.0/16"),
// EnableDnsHostnames: pulumi.Bool(true),
// Tags: pulumi.StringMap{
// "name": pulumi.String("emr_test"),
// },
// })
// if err != nil {
// return err
// }
// mainSubnet, err := ec2.NewSubnet(ctx, "mainSubnet", &ec2.SubnetArgs{
// VpcId: mainVpc.ID(),
// CidrBlock: pulumi.String("168.31.0.0/20"),
// Tags: pulumi.StringMap{
// "name": pulumi.String("emr_test"),
// },
// })
// if err != nil {
// return err
// }
// iamEmrServiceRole, err := iam.NewRole(ctx, "iamEmrServiceRole", &iam.RoleArgs{
// AssumeRolePolicy: pulumi.String(fmt.Sprintf("%v%v%v%v%v%v%v%v%v%v%v%v%v", "{\n", " \"Version\": \"2008-10-17\",\n", " \"Statement\": [\n", " {\n", " \"Sid\": \"\",\n", " \"Effect\": \"Allow\",\n", " \"Principal\": {\n", " \"Service\": \"elasticmapreduce.amazonaws.com\"\n", " },\n", " \"Action\": \"sts:AssumeRole\"\n", " }\n", " ]\n", "}\n")),
// })
// if err != nil {
// return err
// }
// iamEmrProfileRole, err := iam.NewRole(ctx, "iamEmrProfileRole", &iam.RoleArgs{
// AssumeRolePolicy: pulumi.String(fmt.Sprintf("%v%v%v%v%v%v%v%v%v%v%v%v%v", "{\n", " \"Version\": \"2008-10-17\",\n", " \"Statement\": [\n", " {\n", " \"Sid\": \"\",\n", " \"Effect\": \"Allow\",\n", " \"Principal\": {\n", " \"Service\": \"ec2.amazonaws.com\"\n", " },\n", " \"Action\": \"sts:AssumeRole\"\n", " }\n", " ]\n", "}\n")),
// })
// if err != nil {
// return err
// }
// emrProfile, err := iam.NewInstanceProfile(ctx, "emrProfile", &iam.InstanceProfileArgs{
// Role: iamEmrProfileRole.Name,
// })
// if err != nil {
// return err
// }
// _, err = emr.NewCluster(ctx, "cluster", &emr.ClusterArgs{
// ReleaseLabel: pulumi.String("emr-4.6.0"),
// Applications: pulumi.StringArray{
// pulumi.String("Spark"),
// },
// Ec2Attributes: &emr.ClusterEc2AttributesArgs{
// SubnetId: mainSubnet.ID(),
// EmrManagedMasterSecurityGroup: pulumi.Any(aws_security_group.Allow_all.Id),
// EmrManagedSlaveSecurityGroup: pulumi.Any(aws_security_group.Allow_all.Id),
// InstanceProfile: emrProfile.Arn,
// },
// MasterInstanceGroup: &emr.ClusterMasterInstanceGroupArgs{
// InstanceType: pulumi.String("m5.xlarge"),
// },
// CoreInstanceGroup: &emr.ClusterCoreInstanceGroupArgs{
// InstanceCount: pulumi.Int(1),
// InstanceType: pulumi.String("m5.xlarge"),
// },
// Tags: pulumi.StringMap{
// "role": pulumi.String("rolename"),
// "dns_zone": pulumi.String("env_zone"),
// "env": pulumi.String("env"),
// "name": pulumi.String("name-env"),
// },
// BootstrapActions: emr.ClusterBootstrapActionArray{
// &emr.ClusterBootstrapActionArgs{
// Path: pulumi.String("s3://elasticmapreduce/bootstrap-actions/run-if"),
// Name: pulumi.String("runif"),
// Args: pulumi.StringArray{
// pulumi.String("instance.isMaster=true"),
// pulumi.String("echo running on master node"),
// },
// },
// },
// ConfigurationsJson: pulumi.String(fmt.Sprintf("%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v", " [\n", " {\n", " \"Classification\": \"hadoop-env\",\n", " \"Configurations\": [\n", " {\n", " \"Classification\": \"export\",\n", " \"Properties\": {\n", " \"JAVA_HOME\": \"/usr/lib/jvm/java-1.8.0\"\n", " }\n", " }\n", " ],\n", " \"Properties\": {}\n", " },\n", " {\n", " \"Classification\": \"spark-env\",\n", " \"Configurations\": [\n", " {\n", " \"Classification\": \"export\",\n", " \"Properties\": {\n", " \"JAVA_HOME\": \"/usr/lib/jvm/java-1.8.0\"\n", " }\n", " }\n", " ],\n", " \"Properties\": {}\n", " }\n", " ]\n")),
// ServiceRole: iamEmrServiceRole.Arn,
// })
// if err != nil {
// return err
// }
// _, err = ec2.NewSecurityGroup(ctx, "allowAccess", &ec2.SecurityGroupArgs{
// Description: pulumi.String("Allow inbound traffic"),
// VpcId: mainVpc.ID(),
// Ingress: ec2.SecurityGroupIngressArray{
// &ec2.SecurityGroupIngressArgs{
// FromPort: pulumi.Int(0),
// ToPort: pulumi.Int(0),
// Protocol: pulumi.String("-1"),
// CidrBlocks: mainVpc.CidrBlock,
// },
// },
// Egress: ec2.SecurityGroupEgressArray{
// &ec2.SecurityGroupEgressArgs{
// FromPort: pulumi.Int(0),
// ToPort: pulumi.Int(0),
// Protocol: pulumi.String("-1"),
// CidrBlocks: pulumi.StringArray{
// pulumi.String("0.0.0.0/0"),
// },
// },
// },
// Tags: pulumi.StringMap{
// "name": pulumi.String("emr_test"),
// },
// }, pulumi.DependsOn([]pulumi.Resource{
// mainSubnet,
// }))
// if err != nil {
// return err
// }
// gw, err := ec2.NewInternetGateway(ctx, "gw", &ec2.InternetGatewayArgs{
// VpcId: mainVpc.ID(),
// })
// if err != nil {
// return err
// }
// routeTable, err := ec2.NewRouteTable(ctx, "routeTable", &ec2.RouteTableArgs{
// VpcId: mainVpc.ID(),
// Routes: ec2.RouteTableRouteArray{
// &ec2.RouteTableRouteArgs{
// CidrBlock: pulumi.String("0.0.0.0/0"),
// GatewayId: gw.ID(),
// },
// },
// })
// if err != nil {
// return err
// }
// _, err = ec2.NewMainRouteTableAssociation(ctx, "mainRouteTableAssociation", &ec2.MainRouteTableAssociationArgs{
// VpcId: mainVpc.ID(),
// RouteTableId: routeTable.ID(),
// })
// if err != nil {
// return err
// }
// _, err = iam.NewRolePolicy(ctx, "iamEmrServicePolicy", &iam.RolePolicyArgs{
// Role: iamEmrServiceRole.ID(),
// Policy: pulumi.String(fmt.Sprintf("%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v", "{\n", " \"Version\": \"2012-10-17\",\n", " \"Statement\": [{\n", " \"Effect\": \"Allow\",\n", " \"Resource\": \"*\",\n", " \"Action\": [\n", " \"ec2:AuthorizeSecurityGroupEgress\",\n", " \"ec2:AuthorizeSecurityGroupIngress\",\n", " \"ec2:CancelSpotInstanceRequests\",\n", " \"ec2:CreateNetworkInterface\",\n", " \"ec2:CreateSecurityGroup\",\n", " \"ec2:CreateTags\",\n", " \"ec2:DeleteNetworkInterface\",\n", " \"ec2:DeleteSecurityGroup\",\n", " \"ec2:DeleteTags\",\n", " \"ec2:DescribeAvailabilityZones\",\n", " \"ec2:DescribeAccountAttributes\",\n", " \"ec2:DescribeDhcpOptions\",\n", " \"ec2:DescribeInstanceStatus\",\n", " \"ec2:DescribeInstances\",\n", " \"ec2:DescribeKeyPairs\",\n", " \"ec2:DescribeNetworkAcls\",\n", " \"ec2:DescribeNetworkInterfaces\",\n", " \"ec2:DescribePrefixLists\",\n", " \"ec2:DescribeRouteTables\",\n", " \"ec2:DescribeSecurityGroups\",\n", " \"ec2:DescribeSpotInstanceRequests\",\n", " \"ec2:DescribeSpotPriceHistory\",\n", " \"ec2:DescribeSubnets\",\n", " \"ec2:DescribeVpcAttribute\",\n", " \"ec2:DescribeVpcEndpoints\",\n", " \"ec2:DescribeVpcEndpointServices\",\n", " \"ec2:DescribeVpcs\",\n", " \"ec2:DetachNetworkInterface\",\n", " \"ec2:ModifyImageAttribute\",\n", " \"ec2:ModifyInstanceAttribute\",\n", " \"ec2:RequestSpotInstances\",\n", " \"ec2:RevokeSecurityGroupEgress\",\n", " \"ec2:RunInstances\",\n", " \"ec2:TerminateInstances\",\n", " \"ec2:DeleteVolume\",\n", " \"ec2:DescribeVolumeStatus\",\n", " \"ec2:DescribeVolumes\",\n", " \"ec2:DetachVolume\",\n", " \"iam:GetRole\",\n", " \"iam:GetRolePolicy\",\n", " \"iam:ListInstanceProfiles\",\n", " \"iam:ListRolePolicies\",\n", " \"iam:PassRole\",\n", " \"s3:CreateBucket\",\n", " \"s3:Get*\",\n", " \"s3:List*\",\n", " \"sdb:BatchPutAttributes\",\n", " \"sdb:Select\",\n", " \"sqs:CreateQueue\",\n", " \"sqs:Delete*\",\n", " \"sqs:GetQueue*\",\n", " \"sqs:PurgeQueue\",\n", " \"sqs:ReceiveMessage\"\n", " ]\n", " }]\n", "}\n")),
// })
// if err != nil {
// return err
// }
// _, err = iam.NewRolePolicy(ctx, "iamEmrProfilePolicy", &iam.RolePolicyArgs{
// Role: iamEmrProfileRole.ID(),
// Policy: pulumi.String(fmt.Sprintf("%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v", "{\n", " \"Version\": \"2012-10-17\",\n", " \"Statement\": [{\n", " \"Effect\": \"Allow\",\n", " \"Resource\": \"*\",\n", " \"Action\": [\n", " \"cloudwatch:*\",\n", " \"dynamodb:*\",\n", " \"ec2:Describe*\",\n", " \"elasticmapreduce:Describe*\",\n", " \"elasticmapreduce:ListBootstrapActions\",\n", " \"elasticmapreduce:ListClusters\",\n", " \"elasticmapreduce:ListInstanceGroups\",\n", " \"elasticmapreduce:ListInstances\",\n", " \"elasticmapreduce:ListSteps\",\n", " \"kinesis:CreateStream\",\n", " \"kinesis:DeleteStream\",\n", " \"kinesis:DescribeStream\",\n", " \"kinesis:GetRecords\",\n", " \"kinesis:GetShardIterator\",\n", " \"kinesis:MergeShards\",\n", " \"kinesis:PutRecord\",\n", " \"kinesis:SplitShard\",\n", " \"rds:Describe*\",\n", " \"s3:*\",\n", " \"sdb:*\",\n", " \"sns:*\",\n", " \"sqs:*\"\n", " ]\n", " }]\n", "}\n")),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// ## Import
//
// EMR clusters can be imported using the `id`, e.g.
//
// ```sh
// $ pulumi import aws:emr/cluster:Cluster cluster j-123456ABCDEF
// ```
//
// Since the API does not return the actual values for Kerberos configurations, environments with those this provider configurations will need to use the [`ignoreChanges`](https://www.pulumi.com/docs/intro/concepts/programming-model/#ignorechanges) available to all this provider resources to prevent perpetual differences, e.g. terraform resource "aws_emr_cluster" "example" {
//
// # ... other configuration ...
//
// lifecycle {
//
// ignore_changes = [kerberos_attributes]
//
// } }
type Cluster struct {
pulumi.CustomResourceState
// A JSON string for selecting additional features such as adding proxy information. Note: Currently there is no API to retrieve the value of this argument after EMR cluster creation from provider, therefore this provider cannot detect drift from the actual EMR cluster if its value is changed outside this provider.
AdditionalInfo pulumi.StringPtrOutput `pulumi:"additionalInfo"`
// A list of applications for the cluster. Valid values are: `Flink`, `Hadoop`, `Hive`, `Mahout`, `Pig`, `Spark`, and `JupyterHub` (as of EMR 5.14.0). Case insensitive
Applications pulumi.StringArrayOutput `pulumi:"applications"`
Arn pulumi.StringOutput `pulumi:"arn"`
// An IAM role for automatic scaling policies. The IAM role provides permissions that the automatic scaling feature requires to launch and terminate EC2 instances in an instance group.
AutoscalingRole pulumi.StringPtrOutput `pulumi:"autoscalingRole"`
// Ordered list of bootstrap actions that will be run before Hadoop is started on the cluster nodes. Defined below.
BootstrapActions ClusterBootstrapActionArrayOutput `pulumi:"bootstrapActions"`
ClusterState pulumi.StringOutput `pulumi:"clusterState"`
// A configuration classification that applies when provisioning cluster instances, which can include configurations for applications and software that run on the cluster. List of `configuration` blocks.
Configurations pulumi.StringPtrOutput `pulumi:"configurations"`
// A JSON string for supplying list of configurations for the EMR cluster.
ConfigurationsJson pulumi.StringPtrOutput `pulumi:"configurationsJson"`
// Configuration block to use an [Instance Fleet](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-instance-fleet.html) for the core node type. Cannot be specified if any `coreInstanceGroup` configuration blocks are set. Detailed below.
CoreInstanceFleet ClusterCoreInstanceFleetOutput `pulumi:"coreInstanceFleet"`
// Configuration block to use an [Instance Group](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-instance-group-configuration.html#emr-plan-instance-groups) for the [core node type](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-master-core-task-nodes.html#emr-plan-core).
CoreInstanceGroup ClusterCoreInstanceGroupOutput `pulumi:"coreInstanceGroup"`
// A custom Amazon Linux AMI for the cluster (instead of an EMR-owned AMI). Available in Amazon EMR version 5.7.0 and later.
CustomAmiId pulumi.StringPtrOutput `pulumi:"customAmiId"`
// Size in GiB of the EBS root device volume of the Linux AMI that is used for each EC2 instance. Available in Amazon EMR version 4.x and later.
EbsRootVolumeSize pulumi.IntPtrOutput `pulumi:"ebsRootVolumeSize"`
// Attributes for the EC2 instances running the job flow. Defined below
Ec2Attributes ClusterEc2AttributesPtrOutput `pulumi:"ec2Attributes"`
// Switch on/off run cluster with no steps or when all steps are complete (default is on)
KeepJobFlowAliveWhenNoSteps pulumi.BoolOutput `pulumi:"keepJobFlowAliveWhenNoSteps"`
// Kerberos configuration for the cluster. Defined below
KerberosAttributes ClusterKerberosAttributesPtrOutput `pulumi:"kerberosAttributes"`
// S3 bucket to write the log files of the job flow. If a value is not provided, logs are not created
LogUri pulumi.StringPtrOutput `pulumi:"logUri"`
// Configuration block to use an [Instance Fleet](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-instance-fleet.html) for the master node type. Cannot be specified if any `masterInstanceGroup` configuration blocks are set. Detailed below.
MasterInstanceFleet ClusterMasterInstanceFleetOutput `pulumi:"masterInstanceFleet"`
// Configuration block to use an [Instance Group](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-instance-group-configuration.html#emr-plan-instance-groups) for the [master node type](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-master-core-task-nodes.html#emr-plan-master).
MasterInstanceGroup ClusterMasterInstanceGroupOutput `pulumi:"masterInstanceGroup"`
// The public DNS name of the master EC2 instance.
// * `core_instance_group.0.id` - Core node type Instance Group ID, if using Instance Group for this node type.
MasterPublicDns pulumi.StringOutput `pulumi:"masterPublicDns"`
// Friendly name given to the instance fleet.
Name pulumi.StringOutput `pulumi:"name"`
// The release label for the Amazon EMR release
ReleaseLabel pulumi.StringOutput `pulumi:"releaseLabel"`
// The way that individual Amazon EC2 instances terminate when an automatic scale-in activity occurs or an `instance group` is resized.
ScaleDownBehavior pulumi.StringOutput `pulumi:"scaleDownBehavior"`
// The security configuration name to attach to the EMR cluster. Only valid for EMR clusters with `releaseLabel` 4.8.0 or greater
SecurityConfiguration pulumi.StringPtrOutput `pulumi:"securityConfiguration"`
// IAM role that will be assumed by the Amazon EMR service to access AWS resources
ServiceRole pulumi.StringOutput `pulumi:"serviceRole"`
// The number of steps that can be executed concurrently. You can specify a maximum of 256 steps. Only valid for EMR clusters with `releaseLabel` 5.28.0 or greater. (default is 1)
StepConcurrencyLevel pulumi.IntPtrOutput `pulumi:"stepConcurrencyLevel"`
// List of steps to run when creating the cluster. Defined below. It is highly recommended to utilize [`ignoreChanges`](https://www.pulumi.com/docs/intro/concepts/programming-model/#ignorechanges) if other steps are being managed outside of this provider.
Steps ClusterStepArrayOutput `pulumi:"steps"`
// list of tags to apply to the EMR Cluster
Tags pulumi.StringMapOutput `pulumi:"tags"`
// Switch on/off termination protection (default is `false`, except when using multiple master nodes). Before attempting to destroy the resource when termination protection is enabled, this configuration must be applied with its value set to `false`.
TerminationProtection pulumi.BoolOutput `pulumi:"terminationProtection"`
// Whether the job flow is visible to all IAM users of the AWS account associated with the job flow. Default `true`
VisibleToAllUsers pulumi.BoolPtrOutput `pulumi:"visibleToAllUsers"`
}
// NewCluster registers a new resource with the given unique name, arguments, and options.
func NewCluster(ctx *pulumi.Context,
name string, args *ClusterArgs, opts ...pulumi.ResourceOption) (*Cluster, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ReleaseLabel == nil {
return nil, errors.New("invalid value for required argument 'ReleaseLabel'")
}
if args.ServiceRole == nil {
return nil, errors.New("invalid value for required argument 'ServiceRole'")
}
var resource Cluster
err := ctx.RegisterResource("aws:emr/cluster:Cluster", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetCluster gets an existing Cluster resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetCluster(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ClusterState, opts ...pulumi.ResourceOption) (*Cluster, error) {
var resource Cluster
err := ctx.ReadResource("aws:emr/cluster:Cluster", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Cluster resources.
type clusterState struct {
// A JSON string for selecting additional features such as adding proxy information. Note: Currently there is no API to retrieve the value of this argument after EMR cluster creation from provider, therefore this provider cannot detect drift from the actual EMR cluster if its value is changed outside this provider.
AdditionalInfo *string `pulumi:"additionalInfo"`
// A list of applications for the cluster. Valid values are: `Flink`, `Hadoop`, `Hive`, `Mahout`, `Pig`, `Spark`, and `JupyterHub` (as of EMR 5.14.0). Case insensitive
Applications []string `pulumi:"applications"`
Arn *string `pulumi:"arn"`
// An IAM role for automatic scaling policies. The IAM role provides permissions that the automatic scaling feature requires to launch and terminate EC2 instances in an instance group.
AutoscalingRole *string `pulumi:"autoscalingRole"`
// Ordered list of bootstrap actions that will be run before Hadoop is started on the cluster nodes. Defined below.
BootstrapActions []ClusterBootstrapAction `pulumi:"bootstrapActions"`
ClusterState *string `pulumi:"clusterState"`
// A configuration classification that applies when provisioning cluster instances, which can include configurations for applications and software that run on the cluster. List of `configuration` blocks.
Configurations *string `pulumi:"configurations"`
// A JSON string for supplying list of configurations for the EMR cluster.
ConfigurationsJson *string `pulumi:"configurationsJson"`
// Configuration block to use an [Instance Fleet](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-instance-fleet.html) for the core node type. Cannot be specified if any `coreInstanceGroup` configuration blocks are set. Detailed below.
CoreInstanceFleet *ClusterCoreInstanceFleet `pulumi:"coreInstanceFleet"`
// Configuration block to use an [Instance Group](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-instance-group-configuration.html#emr-plan-instance-groups) for the [core node type](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-master-core-task-nodes.html#emr-plan-core).
CoreInstanceGroup *ClusterCoreInstanceGroup `pulumi:"coreInstanceGroup"`
// A custom Amazon Linux AMI for the cluster (instead of an EMR-owned AMI). Available in Amazon EMR version 5.7.0 and later.
CustomAmiId *string `pulumi:"customAmiId"`
// Size in GiB of the EBS root device volume of the Linux AMI that is used for each EC2 instance. Available in Amazon EMR version 4.x and later.
EbsRootVolumeSize *int `pulumi:"ebsRootVolumeSize"`
// Attributes for the EC2 instances running the job flow. Defined below
Ec2Attributes *ClusterEc2Attributes `pulumi:"ec2Attributes"`
// Switch on/off run cluster with no steps or when all steps are complete (default is on)
KeepJobFlowAliveWhenNoSteps *bool `pulumi:"keepJobFlowAliveWhenNoSteps"`
// Kerberos configuration for the cluster. Defined below
KerberosAttributes *ClusterKerberosAttributes `pulumi:"kerberosAttributes"`
// S3 bucket to write the log files of the job flow. If a value is not provided, logs are not created
LogUri *string `pulumi:"logUri"`
// Configuration block to use an [Instance Fleet](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-instance-fleet.html) for the master node type. Cannot be specified if any `masterInstanceGroup` configuration blocks are set. Detailed below.
MasterInstanceFleet *ClusterMasterInstanceFleet `pulumi:"masterInstanceFleet"`
// Configuration block to use an [Instance Group](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-instance-group-configuration.html#emr-plan-instance-groups) for the [master node type](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-master-core-task-nodes.html#emr-plan-master).
MasterInstanceGroup *ClusterMasterInstanceGroup `pulumi:"masterInstanceGroup"`
// The public DNS name of the master EC2 instance.
// * `core_instance_group.0.id` - Core node type Instance Group ID, if using Instance Group for this node type.
MasterPublicDns *string `pulumi:"masterPublicDns"`
// Friendly name given to the instance fleet.
Name *string `pulumi:"name"`
// The release label for the Amazon EMR release
ReleaseLabel *string `pulumi:"releaseLabel"`
// The way that individual Amazon EC2 instances terminate when an automatic scale-in activity occurs or an `instance group` is resized.
ScaleDownBehavior *string `pulumi:"scaleDownBehavior"`
// The security configuration name to attach to the EMR cluster. Only valid for EMR clusters with `releaseLabel` 4.8.0 or greater
SecurityConfiguration *string `pulumi:"securityConfiguration"`
// IAM role that will be assumed by the Amazon EMR service to access AWS resources
ServiceRole *string `pulumi:"serviceRole"`
// The number of steps that can be executed concurrently. You can specify a maximum of 256 steps. Only valid for EMR clusters with `releaseLabel` 5.28.0 or greater. (default is 1)
StepConcurrencyLevel *int `pulumi:"stepConcurrencyLevel"`
// List of steps to run when creating the cluster. Defined below. It is highly recommended to utilize [`ignoreChanges`](https://www.pulumi.com/docs/intro/concepts/programming-model/#ignorechanges) if other steps are being managed outside of this provider.
Steps []ClusterStep `pulumi:"steps"`
// list of tags to apply to the EMR Cluster
Tags map[string]string `pulumi:"tags"`
// Switch on/off termination protection (default is `false`, except when using multiple master nodes). Before attempting to destroy the resource when termination protection is enabled, this configuration must be applied with its value set to `false`.
TerminationProtection *bool `pulumi:"terminationProtection"`
// Whether the job flow is visible to all IAM users of the AWS account associated with the job flow. Default `true`
VisibleToAllUsers *bool `pulumi:"visibleToAllUsers"`
}
type ClusterState struct {
// A JSON string for selecting additional features such as adding proxy information. Note: Currently there is no API to retrieve the value of this argument after EMR cluster creation from provider, therefore this provider cannot detect drift from the actual EMR cluster if its value is changed outside this provider.
AdditionalInfo pulumi.StringPtrInput
// A list of applications for the cluster. Valid values are: `Flink`, `Hadoop`, `Hive`, `Mahout`, `Pig`, `Spark`, and `JupyterHub` (as of EMR 5.14.0). Case insensitive
Applications pulumi.StringArrayInput
Arn pulumi.StringPtrInput
// An IAM role for automatic scaling policies. The IAM role provides permissions that the automatic scaling feature requires to launch and terminate EC2 instances in an instance group.
AutoscalingRole pulumi.StringPtrInput
// Ordered list of bootstrap actions that will be run before Hadoop is started on the cluster nodes. Defined below.
BootstrapActions ClusterBootstrapActionArrayInput
ClusterState pulumi.StringPtrInput
// A configuration classification that applies when provisioning cluster instances, which can include configurations for applications and software that run on the cluster. List of `configuration` blocks.
Configurations pulumi.StringPtrInput
// A JSON string for supplying list of configurations for the EMR cluster.
ConfigurationsJson pulumi.StringPtrInput
// Configuration block to use an [Instance Fleet](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-instance-fleet.html) for the core node type. Cannot be specified if any `coreInstanceGroup` configuration blocks are set. Detailed below.
CoreInstanceFleet ClusterCoreInstanceFleetPtrInput
// Configuration block to use an [Instance Group](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-instance-group-configuration.html#emr-plan-instance-groups) for the [core node type](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-master-core-task-nodes.html#emr-plan-core).
CoreInstanceGroup ClusterCoreInstanceGroupPtrInput
// A custom Amazon Linux AMI for the cluster (instead of an EMR-owned AMI). Available in Amazon EMR version 5.7.0 and later.
CustomAmiId pulumi.StringPtrInput
// Size in GiB of the EBS root device volume of the Linux AMI that is used for each EC2 instance. Available in Amazon EMR version 4.x and later.
EbsRootVolumeSize pulumi.IntPtrInput
// Attributes for the EC2 instances running the job flow. Defined below
Ec2Attributes ClusterEc2AttributesPtrInput
// Switch on/off run cluster with no steps or when all steps are complete (default is on)
KeepJobFlowAliveWhenNoSteps pulumi.BoolPtrInput
// Kerberos configuration for the cluster. Defined below
KerberosAttributes ClusterKerberosAttributesPtrInput
// S3 bucket to write the log files of the job flow. If a value is not provided, logs are not created
LogUri pulumi.StringPtrInput
// Configuration block to use an [Instance Fleet](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-instance-fleet.html) for the master node type. Cannot be specified if any `masterInstanceGroup` configuration blocks are set. Detailed below.
MasterInstanceFleet ClusterMasterInstanceFleetPtrInput
// Configuration block to use an [Instance Group](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-instance-group-configuration.html#emr-plan-instance-groups) for the [master node type](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-master-core-task-nodes.html#emr-plan-master).
MasterInstanceGroup ClusterMasterInstanceGroupPtrInput
// The public DNS name of the master EC2 instance.
// * `core_instance_group.0.id` - Core node type Instance Group ID, if using Instance Group for this node type.
MasterPublicDns pulumi.StringPtrInput
// Friendly name given to the instance fleet.
Name pulumi.StringPtrInput
// The release label for the Amazon EMR release
ReleaseLabel pulumi.StringPtrInput
// The way that individual Amazon EC2 instances terminate when an automatic scale-in activity occurs or an `instance group` is resized.
ScaleDownBehavior pulumi.StringPtrInput
// The security configuration name to attach to the EMR cluster. Only valid for EMR clusters with `releaseLabel` 4.8.0 or greater
SecurityConfiguration pulumi.StringPtrInput
// IAM role that will be assumed by the Amazon EMR service to access AWS resources
ServiceRole pulumi.StringPtrInput
// The number of steps that can be executed concurrently. You can specify a maximum of 256 steps. Only valid for EMR clusters with `releaseLabel` 5.28.0 or greater. (default is 1)
StepConcurrencyLevel pulumi.IntPtrInput
// List of steps to run when creating the cluster. Defined below. It is highly recommended to utilize [`ignoreChanges`](https://www.pulumi.com/docs/intro/concepts/programming-model/#ignorechanges) if other steps are being managed outside of this provider.
Steps ClusterStepArrayInput
// list of tags to apply to the EMR Cluster
Tags pulumi.StringMapInput
// Switch on/off termination protection (default is `false`, except when using multiple master nodes). Before attempting to destroy the resource when termination protection is enabled, this configuration must be applied with its value set to `false`.
TerminationProtection pulumi.BoolPtrInput
// Whether the job flow is visible to all IAM users of the AWS account associated with the job flow. Default `true`
VisibleToAllUsers pulumi.BoolPtrInput
}
func (ClusterState) ElementType() reflect.Type {
return reflect.TypeOf((*clusterState)(nil)).Elem()
}
type clusterArgs struct {
// A JSON string for selecting additional features such as adding proxy information. Note: Currently there is no API to retrieve the value of this argument after EMR cluster creation from provider, therefore this provider cannot detect drift from the actual EMR cluster if its value is changed outside this provider.
AdditionalInfo *string `pulumi:"additionalInfo"`
// A list of applications for the cluster. Valid values are: `Flink`, `Hadoop`, `Hive`, `Mahout`, `Pig`, `Spark`, and `JupyterHub` (as of EMR 5.14.0). Case insensitive
Applications []string `pulumi:"applications"`
// An IAM role for automatic scaling policies. The IAM role provides permissions that the automatic scaling feature requires to launch and terminate EC2 instances in an instance group.
AutoscalingRole *string `pulumi:"autoscalingRole"`
// Ordered list of bootstrap actions that will be run before Hadoop is started on the cluster nodes. Defined below.
BootstrapActions []ClusterBootstrapAction `pulumi:"bootstrapActions"`
// A configuration classification that applies when provisioning cluster instances, which can include configurations for applications and software that run on the cluster. List of `configuration` blocks.
Configurations *string `pulumi:"configurations"`
// A JSON string for supplying list of configurations for the EMR cluster.
ConfigurationsJson *string `pulumi:"configurationsJson"`
// Configuration block to use an [Instance Fleet](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-instance-fleet.html) for the core node type. Cannot be specified if any `coreInstanceGroup` configuration blocks are set. Detailed below.
CoreInstanceFleet *ClusterCoreInstanceFleet `pulumi:"coreInstanceFleet"`
// Configuration block to use an [Instance Group](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-instance-group-configuration.html#emr-plan-instance-groups) for the [core node type](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-master-core-task-nodes.html#emr-plan-core).
CoreInstanceGroup *ClusterCoreInstanceGroup `pulumi:"coreInstanceGroup"`
// A custom Amazon Linux AMI for the cluster (instead of an EMR-owned AMI). Available in Amazon EMR version 5.7.0 and later.
CustomAmiId *string `pulumi:"customAmiId"`
// Size in GiB of the EBS root device volume of the Linux AMI that is used for each EC2 instance. Available in Amazon EMR version 4.x and later.
EbsRootVolumeSize *int `pulumi:"ebsRootVolumeSize"`
// Attributes for the EC2 instances running the job flow. Defined below
Ec2Attributes *ClusterEc2Attributes `pulumi:"ec2Attributes"`
// Switch on/off run cluster with no steps or when all steps are complete (default is on)
KeepJobFlowAliveWhenNoSteps *bool `pulumi:"keepJobFlowAliveWhenNoSteps"`
// Kerberos configuration for the cluster. Defined below
KerberosAttributes *ClusterKerberosAttributes `pulumi:"kerberosAttributes"`
// S3 bucket to write the log files of the job flow. If a value is not provided, logs are not created
LogUri *string `pulumi:"logUri"`
// Configuration block to use an [Instance Fleet](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-instance-fleet.html) for the master node type. Cannot be specified if any `masterInstanceGroup` configuration blocks are set. Detailed below.
MasterInstanceFleet *ClusterMasterInstanceFleet `pulumi:"masterInstanceFleet"`
// Configuration block to use an [Instance Group](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-instance-group-configuration.html#emr-plan-instance-groups) for the [master node type](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-master-core-task-nodes.html#emr-plan-master).
MasterInstanceGroup *ClusterMasterInstanceGroup `pulumi:"masterInstanceGroup"`
// Friendly name given to the instance fleet.
Name *string `pulumi:"name"`
// The release label for the Amazon EMR release
ReleaseLabel string `pulumi:"releaseLabel"`
// The way that individual Amazon EC2 instances terminate when an automatic scale-in activity occurs or an `instance group` is resized.
ScaleDownBehavior *string `pulumi:"scaleDownBehavior"`
// The security configuration name to attach to the EMR cluster. Only valid for EMR clusters with `releaseLabel` 4.8.0 or greater
SecurityConfiguration *string `pulumi:"securityConfiguration"`
// IAM role that will be assumed by the Amazon EMR service to access AWS resources
ServiceRole string `pulumi:"serviceRole"`
// The number of steps that can be executed concurrently. You can specify a maximum of 256 steps. Only valid for EMR clusters with `releaseLabel` 5.28.0 or greater. (default is 1)
StepConcurrencyLevel *int `pulumi:"stepConcurrencyLevel"`
// List of steps to run when creating the cluster. Defined below. It is highly recommended to utilize [`ignoreChanges`](https://www.pulumi.com/docs/intro/concepts/programming-model/#ignorechanges) if other steps are being managed outside of this provider.
Steps []ClusterStep `pulumi:"steps"`
// list of tags to apply to the EMR Cluster
Tags map[string]string `pulumi:"tags"`
// Switch on/off termination protection (default is `false`, except when using multiple master nodes). Before attempting to destroy the resource when termination protection is enabled, this configuration must be applied with its value set to `false`.
TerminationProtection *bool `pulumi:"terminationProtection"`
// Whether the job flow is visible to all IAM users of the AWS account associated with the job flow. Default `true`
VisibleToAllUsers *bool `pulumi:"visibleToAllUsers"`
}
// The set of arguments for constructing a Cluster resource.
type ClusterArgs struct {
// A JSON string for selecting additional features such as adding proxy information. Note: Currently there is no API to retrieve the value of this argument after EMR cluster creation from provider, therefore this provider cannot detect drift from the actual EMR cluster if its value is changed outside this provider.
AdditionalInfo pulumi.StringPtrInput
// A list of applications for the cluster. Valid values are: `Flink`, `Hadoop`, `Hive`, `Mahout`, `Pig`, `Spark`, and `JupyterHub` (as of EMR 5.14.0). Case insensitive
Applications pulumi.StringArrayInput
// An IAM role for automatic scaling policies. The IAM role provides permissions that the automatic scaling feature requires to launch and terminate EC2 instances in an instance group.
AutoscalingRole pulumi.StringPtrInput
// Ordered list of bootstrap actions that will be run before Hadoop is started on the cluster nodes. Defined below.
BootstrapActions ClusterBootstrapActionArrayInput
// A configuration classification that applies when provisioning cluster instances, which can include configurations for applications and software that run on the cluster. List of `configuration` blocks.
Configurations pulumi.StringPtrInput
// A JSON string for supplying list of configurations for the EMR cluster.
ConfigurationsJson pulumi.StringPtrInput
// Configuration block to use an [Instance Fleet](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-instance-fleet.html) for the core node type. Cannot be specified if any `coreInstanceGroup` configuration blocks are set. Detailed below.
CoreInstanceFleet ClusterCoreInstanceFleetPtrInput
// Configuration block to use an [Instance Group](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-instance-group-configuration.html#emr-plan-instance-groups) for the [core node type](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-master-core-task-nodes.html#emr-plan-core).
CoreInstanceGroup ClusterCoreInstanceGroupPtrInput
// A custom Amazon Linux AMI for the cluster (instead of an EMR-owned AMI). Available in Amazon EMR version 5.7.0 and later.
CustomAmiId pulumi.StringPtrInput
// Size in GiB of the EBS root device volume of the Linux AMI that is used for each EC2 instance. Available in Amazon EMR version 4.x and later.
EbsRootVolumeSize pulumi.IntPtrInput
// Attributes for the EC2 instances running the job flow. Defined below
Ec2Attributes ClusterEc2AttributesPtrInput
// Switch on/off run cluster with no steps or when all steps are complete (default is on)
KeepJobFlowAliveWhenNoSteps pulumi.BoolPtrInput
// Kerberos configuration for the cluster. Defined below
KerberosAttributes ClusterKerberosAttributesPtrInput
// S3 bucket to write the log files of the job flow. If a value is not provided, logs are not created
LogUri pulumi.StringPtrInput
// Configuration block to use an [Instance Fleet](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-instance-fleet.html) for the master node type. Cannot be specified if any `masterInstanceGroup` configuration blocks are set. Detailed below.
MasterInstanceFleet ClusterMasterInstanceFleetPtrInput
// Configuration block to use an [Instance Group](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-instance-group-configuration.html#emr-plan-instance-groups) for the [master node type](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-master-core-task-nodes.html#emr-plan-master).
MasterInstanceGroup ClusterMasterInstanceGroupPtrInput
// Friendly name given to the instance fleet.
Name pulumi.StringPtrInput
// The release label for the Amazon EMR release
ReleaseLabel pulumi.StringInput
// The way that individual Amazon EC2 instances terminate when an automatic scale-in activity occurs or an `instance group` is resized.
ScaleDownBehavior pulumi.StringPtrInput
// The security configuration name to attach to the EMR cluster. Only valid for EMR clusters with `releaseLabel` 4.8.0 or greater
SecurityConfiguration pulumi.StringPtrInput
// IAM role that will be assumed by the Amazon EMR service to access AWS resources
ServiceRole pulumi.StringInput
// The number of steps that can be executed concurrently. You can specify a maximum of 256 steps. Only valid for EMR clusters with `releaseLabel` 5.28.0 or greater. (default is 1)
StepConcurrencyLevel pulumi.IntPtrInput
// List of steps to run when creating the cluster. Defined below. It is highly recommended to utilize [`ignoreChanges`](https://www.pulumi.com/docs/intro/concepts/programming-model/#ignorechanges) if other steps are being managed outside of this provider.
Steps ClusterStepArrayInput
// list of tags to apply to the EMR Cluster
Tags pulumi.StringMapInput
// Switch on/off termination protection (default is `false`, except when using multiple master nodes). Before attempting to destroy the resource when termination protection is enabled, this configuration must be applied with its value set to `false`.
TerminationProtection pulumi.BoolPtrInput
// Whether the job flow is visible to all IAM users of the AWS account associated with the job flow. Default `true`
VisibleToAllUsers pulumi.BoolPtrInput
}
func (ClusterArgs) ElementType() reflect.Type {
return reflect.TypeOf((*clusterArgs)(nil)).Elem()
}
type ClusterInput interface {
pulumi.Input
ToClusterOutput() ClusterOutput
ToClusterOutputWithContext(ctx context.Context) ClusterOutput
}
func (*Cluster) ElementType() reflect.Type {
return reflect.TypeOf((*Cluster)(nil))
}
func (i *Cluster) ToClusterOutput() ClusterOutput {
return i.ToClusterOutputWithContext(context.Background())
}
func (i *Cluster) ToClusterOutputWithContext(ctx context.Context) ClusterOutput {
return pulumi.ToOutputWithContext(ctx, i).(ClusterOutput)
}
func (i *Cluster) ToClusterPtrOutput() ClusterPtrOutput {
return i.ToClusterPtrOutputWithContext(context.Background())
}
func (i *Cluster) ToClusterPtrOutputWithContext(ctx context.Context) ClusterPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(ClusterPtrOutput)
}
type ClusterPtrInput interface {
pulumi.Input
ToClusterPtrOutput() ClusterPtrOutput
ToClusterPtrOutputWithContext(ctx context.Context) ClusterPtrOutput
}
type clusterPtrType ClusterArgs
func (*clusterPtrType) ElementType() reflect.Type {
return reflect.TypeOf((**Cluster)(nil))
}
func (i *clusterPtrType) ToClusterPtrOutput() ClusterPtrOutput {
return i.ToClusterPtrOutputWithContext(context.Background())
}
func (i *clusterPtrType) ToClusterPtrOutputWithContext(ctx context.Context) ClusterPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(ClusterPtrOutput)
}
// ClusterArrayInput is an input type that accepts ClusterArray and ClusterArrayOutput values.
// You can construct a concrete instance of `ClusterArrayInput` via:
//
// ClusterArray{ ClusterArgs{...} }
type ClusterArrayInput interface {
pulumi.Input
ToClusterArrayOutput() ClusterArrayOutput
ToClusterArrayOutputWithContext(context.Context) ClusterArrayOutput
}
type ClusterArray []ClusterInput
func (ClusterArray) ElementType() reflect.Type {
return reflect.TypeOf(([]*Cluster)(nil))
}
func (i ClusterArray) ToClusterArrayOutput() ClusterArrayOutput {
return i.ToClusterArrayOutputWithContext(context.Background())
}
func (i ClusterArray) ToClusterArrayOutputWithContext(ctx context.Context) ClusterArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(ClusterArrayOutput)
}
// ClusterMapInput is an input type that accepts ClusterMap and ClusterMapOutput values.
// You can construct a concrete instance of `ClusterMapInput` via:
//
// ClusterMap{ "key": ClusterArgs{...} }
type ClusterMapInput interface {
pulumi.Input
ToClusterMapOutput() ClusterMapOutput
ToClusterMapOutputWithContext(context.Context) ClusterMapOutput
}
type ClusterMap map[string]ClusterInput
func (ClusterMap) ElementType() reflect.Type {
return reflect.TypeOf((map[string]*Cluster)(nil))
}
func (i ClusterMap) ToClusterMapOutput() ClusterMapOutput {
return i.ToClusterMapOutputWithContext(context.Background())
}
func (i ClusterMap) ToClusterMapOutputWithContext(ctx context.Context) ClusterMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(ClusterMapOutput)
}
type ClusterOutput struct {
*pulumi.OutputState
}
func (ClusterOutput) ElementType() reflect.Type {
return reflect.TypeOf((*Cluster)(nil))
}
func (o ClusterOutput) ToClusterOutput() ClusterOutput {
return o
}
func (o ClusterOutput) ToClusterOutputWithContext(ctx context.Context) ClusterOutput {
return o
}
func (o ClusterOutput) ToClusterPtrOutput() ClusterPtrOutput {
return o.ToClusterPtrOutputWithContext(context.Background())
}
func (o ClusterOutput) ToClusterPtrOutputWithContext(ctx context.Context) ClusterPtrOutput {
return o.ApplyT(func(v Cluster) *Cluster {
return &v
}).(ClusterPtrOutput)
}
type ClusterPtrOutput struct {
*pulumi.OutputState
}
func (ClusterPtrOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Cluster)(nil))
}
func (o ClusterPtrOutput) ToClusterPtrOutput() ClusterPtrOutput {
return o
}
func (o ClusterPtrOutput) ToClusterPtrOutputWithContext(ctx context.Context) ClusterPtrOutput {
return o
}
type ClusterArrayOutput struct{ *pulumi.OutputState }
func (ClusterArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]Cluster)(nil))
}
func (o ClusterArrayOutput) ToClusterArrayOutput() ClusterArrayOutput {
return o
}
func (o ClusterArrayOutput) ToClusterArrayOutputWithContext(ctx context.Context) ClusterArrayOutput {
return o
}
func (o ClusterArrayOutput) Index(i pulumi.IntInput) ClusterOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) Cluster {
return vs[0].([]Cluster)[vs[1].(int)]
}).(ClusterOutput)
}
type ClusterMapOutput struct{ *pulumi.OutputState }
func (ClusterMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]Cluster)(nil))
}
func (o ClusterMapOutput) ToClusterMapOutput() ClusterMapOutput {
return o
}
func (o ClusterMapOutput) ToClusterMapOutputWithContext(ctx context.Context) ClusterMapOutput {
return o
}
func (o ClusterMapOutput) MapIndex(k pulumi.StringInput) ClusterOutput {