Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add unhealthy_node_replacement arg for aws_emr_cluster #36523

3 changes: 3 additions & 0 deletions .changelog/36523.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/aws_emr_cluster: Add `unhealthy_node_replacement` argument
```
21 changes: 18 additions & 3 deletions internal/service/emr/block_public_access_configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
"github.com/hashicorp/terraform-provider-aws/internal/conns"
"github.com/hashicorp/terraform-provider-aws/internal/create"
"github.com/hashicorp/terraform-provider-aws/internal/tfresource"
"github.com/hashicorp/terraform-provider-aws/names"
)

// @SDKResource("aws_emr_block_public_access_configuration")
func ResourceBlockPublicAccessConfiguration() *schema.Resource {
// @SDKResource("aws_emr_block_public_access_configuration", name="Block Public Access Configuration")
func resourceBlockPublicAccessConfiguration() *schema.Resource {
return &schema.Resource{
CreateWithoutTimeout: resourceBlockPublicAccessConfigurationCreate,
ReadWithoutTimeout: resourceBlockPublicAccessConfigurationRead,
Expand Down Expand Up @@ -94,7 +95,7 @@ func resourceBlockPublicAccessConfigurationRead(ctx context.Context, d *schema.R

conn := meta.(*conns.AWSClient).EMRConn(ctx)

out, err := FindBlockPublicAccessConfiguration(ctx, conn)
out, err := findBlockPublicAccessConfiguration(ctx, conn)

if err != nil {
return create.AppendDiagError(diags, names.EMR, create.ErrActionReading, ResNameBlockPublicAccessConfiguration, d.Id(), err)
Expand Down Expand Up @@ -128,6 +129,20 @@ func resourceBlockPublicAccessConfigurationDelete(ctx context.Context, d *schema
return diags
}

func findBlockPublicAccessConfiguration(ctx context.Context, conn *emr.EMR) (*emr.GetBlockPublicAccessConfigurationOutput, error) {
input := &emr.GetBlockPublicAccessConfigurationInput{}
output, err := conn.GetBlockPublicAccessConfigurationWithContext(ctx, input)
if err != nil {
return nil, err
}

if output == nil || output.BlockPublicAccessConfiguration == nil {
return nil, tfresource.NewEmptyResultError(input)
}

return output, nil
}

func findDefaultBlockPublicAccessConfiguration() *emr.BlockPublicAccessConfiguration {
defaultPort := int64(defaultPermittedPublicSecurityGroupRulePort)
defaultPortPointer := &defaultPort
Expand Down
Loading
Loading