Skip to content

Commit

Permalink
issue hashicorp#1146 - Added instance fleet resource for AWS EMR
Browse files Browse the repository at this point in the history
issue hashicorp#1146 - Extend EMR ec2_attributtes with subnet_ids, availability_zone, availability_zones. Added hadoop_version parameter.

issue hashicorp#1146 - Use EMR constants. Reuse EBS config schema to avoid redundancy. Updated EMR documentation
  • Loading branch information
jose manuel santorum authored and PA committed Sep 6, 2018
1 parent 130774c commit ba348e1
Show file tree
Hide file tree
Showing 44 changed files with 2,205 additions and 189 deletions.
2 changes: 1 addition & 1 deletion aws/data_source_aws_cloudformation_export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func TestAccAWSCloudformationExportDataSource_basic(t *testing.T) {
Providers: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccCheckAwsCloudformationExportConfig(rName),
Config: testAccCheckAwsCloudformationExportConfig(rName),
PreventPostDestroyRefresh: true,
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("data.aws_cloudformation_export.waiter", "value", "waiter"),
Expand Down
24 changes: 12 additions & 12 deletions aws/opsworks_layers.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,13 +345,13 @@ func (lt *opsworksLayerType) Create(d *schema.ResourceData, client *opsworks.Ops
EnableAutoHealing: aws.Bool(d.Get("auto_healing").(bool)),
InstallUpdatesOnBoot: aws.Bool(d.Get("install_updates_on_boot").(bool)),
LifecycleEventConfiguration: lt.LifecycleEventConfiguration(d),
Name: aws.String(d.Get("name").(string)),
Packages: expandStringSet(d.Get("system_packages").(*schema.Set)),
Type: aws.String(lt.TypeName),
StackId: aws.String(d.Get("stack_id").(string)),
UseEbsOptimizedInstances: aws.Bool(d.Get("use_ebs_optimized_instances").(bool)),
Attributes: lt.AttributeMap(d),
VolumeConfigurations: lt.VolumeConfigurations(d),
Name: aws.String(d.Get("name").(string)),
Packages: expandStringSet(d.Get("system_packages").(*schema.Set)),
Type: aws.String(lt.TypeName),
StackId: aws.String(d.Get("stack_id").(string)),
UseEbsOptimizedInstances: aws.Bool(d.Get("use_ebs_optimized_instances").(bool)),
Attributes: lt.AttributeMap(d),
VolumeConfigurations: lt.VolumeConfigurations(d),
}

if lt.CustomShortName {
Expand Down Expand Up @@ -399,11 +399,11 @@ func (lt *opsworksLayerType) Update(d *schema.ResourceData, client *opsworks.Ops
EnableAutoHealing: aws.Bool(d.Get("auto_healing").(bool)),
InstallUpdatesOnBoot: aws.Bool(d.Get("install_updates_on_boot").(bool)),
LifecycleEventConfiguration: lt.LifecycleEventConfiguration(d),
Name: aws.String(d.Get("name").(string)),
Packages: expandStringSet(d.Get("system_packages").(*schema.Set)),
UseEbsOptimizedInstances: aws.Bool(d.Get("use_ebs_optimized_instances").(bool)),
Attributes: lt.AttributeMap(d),
VolumeConfigurations: lt.VolumeConfigurations(d),
Name: aws.String(d.Get("name").(string)),
Packages: expandStringSet(d.Get("system_packages").(*schema.Set)),
UseEbsOptimizedInstances: aws.Bool(d.Get("use_ebs_optimized_instances").(bool)),
Attributes: lt.AttributeMap(d),
VolumeConfigurations: lt.VolumeConfigurations(d),
}

if lt.CustomShortName {
Expand Down
1 change: 1 addition & 0 deletions aws/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@ func Provider() terraform.ResourceProvider {
"aws_elb": resourceAwsElb(),
"aws_elb_attachment": resourceAwsElbAttachment(),
"aws_emr_cluster": resourceAwsEMRCluster(),
"aws_emr_instance_fleet": resourceAwsEMRInstanceFleet(),
"aws_emr_instance_group": resourceAwsEMRInstanceGroup(),
"aws_emr_security_configuration": resourceAwsEMRSecurityConfiguration(),
"aws_flow_log": resourceAwsFlowLog(),
Expand Down
6 changes: 3 additions & 3 deletions aws/resource_aws_acmpca_certificate_authority.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ func resourceAwsAcmpcaCertificateAuthorityCreate(d *schema.ResourceData, meta in
if v, ok := d.GetOk("tags"); ok {
input := &acmpca.TagCertificateAuthorityInput{
CertificateAuthorityArn: aws.String(d.Id()),
Tags: tagsFromMapACMPCA(v.(map[string]interface{})),
Tags: tagsFromMapACMPCA(v.(map[string]interface{})),
}

log.Printf("[DEBUG] Tagging ACMPCA Certificate Authority: %s", input)
Expand Down Expand Up @@ -458,7 +458,7 @@ func resourceAwsAcmpcaCertificateAuthorityUpdate(d *schema.ResourceData, meta in
log.Printf("[DEBUG] Removing ACMPCA Certificate Authority %q tags: %#v", d.Id(), remove)
_, err := conn.UntagCertificateAuthority(&acmpca.UntagCertificateAuthorityInput{
CertificateAuthorityArn: aws.String(d.Id()),
Tags: remove,
Tags: remove,
})
if err != nil {
return fmt.Errorf("error updating ACMPCA Certificate Authority %q tags: %s", d.Id(), err)
Expand All @@ -468,7 +468,7 @@ func resourceAwsAcmpcaCertificateAuthorityUpdate(d *schema.ResourceData, meta in
log.Printf("[DEBUG] Creating ACMPCA Certificate Authority %q tags: %#v", d.Id(), create)
_, err := conn.TagCertificateAuthority(&acmpca.TagCertificateAuthorityInput{
CertificateAuthorityArn: aws.String(d.Id()),
Tags: create,
Tags: create,
})
if err != nil {
return fmt.Errorf("error updating ACMPCA Certificate Authority %q tags: %s", d.Id(), err)
Expand Down
30 changes: 15 additions & 15 deletions aws/resource_aws_api_gateway_integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,22 +243,22 @@ func resourceAwsApiGatewayIntegrationCreate(d *schema.ResourceData, meta interfa
}

_, err := conn.PutIntegration(&apigateway.PutIntegrationInput{
HttpMethod: aws.String(d.Get("http_method").(string)),
ResourceId: aws.String(d.Get("resource_id").(string)),
RestApiId: aws.String(d.Get("rest_api_id").(string)),
Type: aws.String(d.Get("type").(string)),
HttpMethod: aws.String(d.Get("http_method").(string)),
ResourceId: aws.String(d.Get("resource_id").(string)),
RestApiId: aws.String(d.Get("rest_api_id").(string)),
Type: aws.String(d.Get("type").(string)),
IntegrationHttpMethod: integrationHttpMethod,
Uri: uri,
RequestParameters: aws.StringMap(parameters),
RequestTemplates: aws.StringMap(templates),
Credentials: credentials,
CacheNamespace: cacheNamespace,
CacheKeyParameters: cacheKeyParameters,
PassthroughBehavior: passthroughBehavior,
ContentHandling: contentHandling,
ConnectionType: connectionType,
ConnectionId: connectionId,
TimeoutInMillis: timeoutInMillis,
Uri: uri,
RequestParameters: aws.StringMap(parameters),
RequestTemplates: aws.StringMap(templates),
Credentials: credentials,
CacheNamespace: cacheNamespace,
CacheKeyParameters: cacheKeyParameters,
PassthroughBehavior: passthroughBehavior,
ContentHandling: contentHandling,
ConnectionType: connectionType,
ConnectionId: connectionId,
TimeoutInMillis: timeoutInMillis,
})
if err != nil {
return fmt.Errorf("Error creating API Gateway Integration: %s", err)
Expand Down
4 changes: 2 additions & 2 deletions aws/resource_aws_cloudfront_origin_access_identity.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ func resourceAwsCloudFrontOriginAccessIdentityRead(d *schema.ResourceData, meta
func resourceAwsCloudFrontOriginAccessIdentityUpdate(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).cloudfrontconn
params := &cloudfront.UpdateCloudFrontOriginAccessIdentityInput{
Id: aws.String(d.Id()),
Id: aws.String(d.Id()),
CloudFrontOriginAccessIdentityConfig: expandOriginAccessIdentityConfig(d),
IfMatch: aws.String(d.Get("etag").(string)),
IfMatch: aws.String(d.Get("etag").(string)),
}
_, err := conn.UpdateCloudFrontOriginAccessIdentity(params)
if err != nil {
Expand Down
8 changes: 4 additions & 4 deletions aws/resource_aws_codedeploy_deployment_group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1568,7 +1568,7 @@ func TestAWSCodeDeployDeploymentGroup_expandBlueGreenDeploymentConfig(t *testing

"terminate_blue_instances_on_deployment_success": []interface{}{
map[string]interface{}{
"action": "TERMINATE",
"action": "TERMINATE",
"termination_wait_time_in_minutes": 90,
},
},
Expand All @@ -1586,7 +1586,7 @@ func TestAWSCodeDeployDeploymentGroup_expandBlueGreenDeploymentConfig(t *testing
},

TerminateBlueInstancesOnDeploymentSuccess: &codedeploy.BlueInstanceTerminationOption{
Action: aws.String("TERMINATE"),
Action: aws.String("TERMINATE"),
TerminationWaitTimeInMinutes: aws.Int64(90),
},
}
Expand All @@ -1611,7 +1611,7 @@ func TestAWSCodeDeployDeploymentGroup_flattenBlueGreenDeploymentConfig(t *testin
},

TerminateBlueInstancesOnDeploymentSuccess: &codedeploy.BlueInstanceTerminationOption{
Action: aws.String("KEEP_ALIVE"),
Action: aws.String("KEEP_ALIVE"),
TerminationWaitTimeInMinutes: aws.Int64(90),
},
}
Expand All @@ -1632,7 +1632,7 @@ func TestAWSCodeDeployDeploymentGroup_flattenBlueGreenDeploymentConfig(t *testin

"terminate_blue_instances_on_deployment_success": []map[string]interface{}{
{
"action": "KEEP_ALIVE",
"action": "KEEP_ALIVE",
"termination_wait_time_in_minutes": 90,
},
},
Expand Down
2 changes: 1 addition & 1 deletion aws/resource_aws_db_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ func resourceAwsDbInstanceCreate(d *schema.ResourceData, meta interface{}) error
DBInstanceIdentifier: aws.String(identifier),
PubliclyAccessible: aws.Bool(d.Get("publicly_accessible").(bool)),
SourceDBInstanceIdentifier: aws.String(v.(string)),
Tags: tags,
Tags: tags,
}

if attr, ok := d.GetOk("allocated_storage"); ok {
Expand Down
2 changes: 1 addition & 1 deletion aws/resource_aws_db_security_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func resourceAwsDbSecurityGroupCreate(d *schema.ResourceData, meta interface{})
opts := rds.CreateDBSecurityGroupInput{
DBSecurityGroupName: aws.String(d.Get("name").(string)),
DBSecurityGroupDescription: aws.String(d.Get("description").(string)),
Tags: tags,
Tags: tags,
}

log.Printf("[DEBUG] DB Security Group create configuration: %#v", opts)
Expand Down
2 changes: 1 addition & 1 deletion aws/resource_aws_dms_replication_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func resourceAwsDmsReplicationInstanceCreate(d *schema.ResourceData, meta interf
PubliclyAccessible: aws.Bool(d.Get("publicly_accessible").(bool)),
ReplicationInstanceClass: aws.String(d.Get("replication_instance_class").(string)),
ReplicationInstanceIdentifier: aws.String(d.Get("replication_instance_id").(string)),
Tags: dmsTagsFromMap(d.Get("tags").(map[string]interface{})),
Tags: dmsTagsFromMap(d.Get("tags").(map[string]interface{})),
}

// WARNING: GetOk returns the zero value for the type if the key is omitted in config. This means for optional
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func TestAwsElasticacheReplicationGroupMigrateState(t *testing.T) {
"v0Tov1": {
StateVersion: 0,
Attributes: map[string]string{
"cluster_mode.#": "1",
"cluster_mode.#": "1",
"cluster_mode.4170186206.num_node_groups": "2",
"cluster_mode.4170186206.replicas_per_node_group": "1",
},
Expand Down
Loading

0 comments on commit ba348e1

Please sign in to comment.