From 0e08f1af1f2fb5308f57f4260e2230ba3b77adfc Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 15 Sep 2021 16:39:45 -0400 Subject: [PATCH 01/33] Run 'GOPRIVATE=github.com/hashicorp/aws-sdk-go-private,github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go go mod tidy'. --- .../cloudformation/cfjsonpatch/cfjsonpatch.go | 102 +++ .../waiter/resource_request_status_status.go | 29 + .../waiter/resource_request_status_waiter.go | 43 ++ aws/resource_aws_cloudformation_resource.go | 357 ++++++++++ ...source_aws_cloudformation_resource_test.go | 664 ++++++++++++++++++ go.mod | 5 + go.sum | 629 ----------------- .../r/cloudformation_resource.html.markdown | 48 ++ 8 files changed, 1248 insertions(+), 629 deletions(-) create mode 100644 aws/internal/service/cloudformation/cfjsonpatch/cfjsonpatch.go create mode 100644 aws/internal/service/cloudformation/waiter/resource_request_status_status.go create mode 100644 aws/internal/service/cloudformation/waiter/resource_request_status_waiter.go create mode 100644 aws/resource_aws_cloudformation_resource.go create mode 100644 aws/resource_aws_cloudformation_resource_test.go delete mode 100644 go.sum create mode 100644 website/docs/r/cloudformation_resource.html.markdown diff --git a/aws/internal/service/cloudformation/cfjsonpatch/cfjsonpatch.go b/aws/internal/service/cloudformation/cfjsonpatch/cfjsonpatch.go new file mode 100644 index 00000000000..34b96a5962a --- /dev/null +++ b/aws/internal/service/cloudformation/cfjsonpatch/cfjsonpatch.go @@ -0,0 +1,102 @@ +// cfjsonpatch implements CloudFormation customizations for RFC 6902 JSON Patch operations. +// +// This functionality is temporary, as the API will be updated to support standard +// RFC 6902 JSON Patch Value field. +package cfjsonpatch + +import ( + "encoding/json" + "fmt" + "log" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/cloudformation" + "github.com/mattbaird/jsonpatch" +) + +const ( + EmptyDocument = "{}" +) + +func PatchOperations(oldRaw interface{}, newRaw interface{}) ([]*cloudformation.PatchOperation, error) { + old, ok := oldRaw.(string) + + if !ok { + old = EmptyDocument + } + + new, ok := newRaw.(string) + + if !ok { + new = EmptyDocument + } + + rfc6902patch, err := createRFC6902Patch([]byte(old), []byte(new)) + + if err != nil { + return nil, err + } + + return convertRFC6902Patch(rfc6902patch) +} + +func createRFC6902Patch(a []byte, b []byte) ([]jsonpatch.JsonPatchOperation, error) { + patch, err := jsonpatch.CreatePatch(a, b) + + if err != nil { + return nil, err + } + + log.Printf("[DEBUG] RFC 6902 JSON Patch: %s", patch) + + return patch, nil +} + +func convertRFC6902Patch(patches []jsonpatch.JsonPatchOperation) ([]*cloudformation.PatchOperation, error) { + patchOperations := make([]*cloudformation.PatchOperation, len(patches)) + + for idx, patch := range patches { + patchOperation := &cloudformation.PatchOperation{ + Op: aws.String(patch.Operation), + Path: aws.String(patch.Path), + } + + if patch.Value == nil { + patchOperations[idx] = patchOperation + continue + } + + switch value := patch.Value.(type) { + default: + log.Printf("[DEBUG] Object JSON Patch value type: %T", value) + + v, err := json.Marshal(value) + + if err != nil { + return nil, fmt.Errorf("unable to marshal JSON Patch value: %w", err) + } + + patchOperation.ObjectValue = aws.String(string(v)) + case bool: + patchOperation.BooleanValue = aws.Bool(value) + case float64: + // jsonpatch does not differentiate between integer versus number types + // and proper typing would require the CloudFormation resource schema. + // To keep things simple for now since most properties are integer, + // fuzzy match round numbers to integer values. + if value == float64(int64(value)) { + patchOperation.IntegerValue = aws.Int64(int64(value)) + } else { + patchOperation.NumberValue = aws.Float64(value) + } + case string: + patchOperation.StringValue = aws.String(value) + } + + patchOperations[idx] = patchOperation + } + + log.Printf("[DEBUG] CloudFormation JSON Patch: %s", patchOperations) + + return patchOperations, nil +} diff --git a/aws/internal/service/cloudformation/waiter/resource_request_status_status.go b/aws/internal/service/cloudformation/waiter/resource_request_status_status.go new file mode 100644 index 00000000000..083621b74f4 --- /dev/null +++ b/aws/internal/service/cloudformation/waiter/resource_request_status_status.go @@ -0,0 +1,29 @@ +package waiter + +import ( + "context" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/cloudformation" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" +) + +func ResourceRequestStatusProgressEventOperationStatus(ctx context.Context, conn *cloudformation.CloudFormation, requestToken string) resource.StateRefreshFunc { + return func() (interface{}, string, error) { + input := &cloudformation.GetResourceRequestStatusInput{ + RequestToken: aws.String(requestToken), + } + + output, err := conn.GetResourceRequestStatusWithContext(ctx, input) + + if err != nil { + return nil, "", err + } + + if output == nil || output.ProgressEvent == nil { + return nil, "", nil + } + + return output.ProgressEvent, aws.StringValue(output.ProgressEvent.OperationStatus), nil + } +} diff --git a/aws/internal/service/cloudformation/waiter/resource_request_status_waiter.go b/aws/internal/service/cloudformation/waiter/resource_request_status_waiter.go new file mode 100644 index 00000000000..8e4d42b684e --- /dev/null +++ b/aws/internal/service/cloudformation/waiter/resource_request_status_waiter.go @@ -0,0 +1,43 @@ +package waiter + +import ( + "context" + "errors" + "fmt" + "time" + + "github.com/aws/aws-sdk-go/service/cloudformation" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" +) + +func ResourceRequestStatusProgressEventOperationStatusSuccess(ctx context.Context, conn *cloudformation.CloudFormation, requestToken string, timeout time.Duration) (*cloudformation.ProgressEvent, error) { + stateConf := &resource.StateChangeConf{ + Pending: []string{ + cloudformation.OperationStatusInProgress, + cloudformation.OperationStatusPending, + }, + Target: []string{cloudformation.OperationStatusSuccess}, + Refresh: ResourceRequestStatusProgressEventOperationStatus(ctx, conn, requestToken), + Timeout: timeout, + } + + outputRaw, err := stateConf.WaitForStateContext(ctx) + + if output, ok := outputRaw.(*cloudformation.ProgressEvent); ok { + if err != nil && output != nil { + newErr := fmt.Errorf("%s", output) + + var te *resource.TimeoutError + var use *resource.UnexpectedStateError + if ok := errors.As(err, &te); ok && te.LastError == nil { + te.LastError = newErr + } else if ok := errors.As(err, &use); ok && use.LastError == nil { + use.LastError = newErr + } + } + + return output, err + } + + return nil, err +} diff --git a/aws/resource_aws_cloudformation_resource.go b/aws/resource_aws_cloudformation_resource.go new file mode 100644 index 00000000000..5e01a534583 --- /dev/null +++ b/aws/resource_aws_cloudformation_resource.go @@ -0,0 +1,357 @@ +package aws + +import ( + "context" + "fmt" + "log" + "regexp" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/cloudformation" + cfschema "github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go" + "github.com/hashicorp/aws-sdk-go-base/tfawserr" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/cloudformation/cfjsonpatch" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/cloudformation/waiter" +) + +func resourceAwsCloudFormationResource() *schema.Resource { + return &schema.Resource{ + CreateContext: resourceAwsCloudFormationResourceCreate, + DeleteContext: resourceAwsCloudFormationResourceDelete, + ReadContext: resourceAwsCloudFormationResourceRead, + UpdateContext: resourceAwsCloudFormationResourceUpdate, + + Timeouts: &schema.ResourceTimeout{ + Create: schema.DefaultTimeout(2 * time.Hour), + Delete: schema.DefaultTimeout(2 * time.Hour), + Update: schema.DefaultTimeout(2 * time.Hour), + }, + + Schema: map[string]*schema.Schema{ + "desired_state": { + Type: schema.TypeString, + Required: true, + }, + "resource_model": { + Type: schema.TypeString, + Computed: true, + }, + "role_arn": { + Type: schema.TypeString, + Optional: true, + }, + "schema": { + Type: schema.TypeString, + Optional: true, + Computed: true, + Sensitive: true, + }, + "type_name": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validation.StringMatch(regexp.MustCompile(`[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}`), "must be three alphanumeric sections separated by double colons (::)"), + }, + "type_version_id": { + Type: schema.TypeString, + Optional: true, + }, + }, + + CustomizeDiff: customdiff.Sequence( + resourceAwsCloudFormationResourceCustomizeDiffGetSchema, + resourceAwsCloudFormationResourceCustomizeDiffSchemaDiff, + customdiff.ComputedIf("resource_model", func(ctx context.Context, diff *schema.ResourceDiff, meta interface{}) bool { + return diff.HasChange("desired_state") + }), + ), + } +} + +func resourceAwsCloudFormationResourceCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + conn := meta.(*AWSClient).cfconn + + input := &cloudformation.CreateResourceInput{ + ClientToken: aws.String(resource.UniqueId()), + } + + if v, ok := d.GetOk("desired_state"); ok { + input.DesiredState = aws.String(v.(string)) + } + + if v, ok := d.GetOk("role_arn"); ok { + input.RoleArn = aws.String(v.(string)) + } + + if v, ok := d.GetOk("type_name"); ok { + input.TypeName = aws.String(v.(string)) + } + + if v, ok := d.GetOk("type_version_id"); ok { + input.TypeVersionId = aws.String(v.(string)) + } + + output, err := conn.CreateResourceWithContext(ctx, input) + + if err != nil { + return diag.FromErr(fmt.Errorf("error creating CloudFormation Resource: %w", err)) + } + + if output == nil || output.ProgressEvent == nil { + return diag.FromErr(fmt.Errorf("error creating CloudFormation Resource: empty response")) + } + + // Always try to capture the identifier before returning errors + d.SetId(aws.StringValue(output.ProgressEvent.Identifier)) + + output.ProgressEvent, err = waiter.ResourceRequestStatusProgressEventOperationStatusSuccess(ctx, conn, aws.StringValue(output.ProgressEvent.RequestToken), d.Timeout(schema.TimeoutCreate)) + + if err != nil { + return diag.FromErr(fmt.Errorf("error waiting for CloudForamtion Resource (%s) creation: %w", d.Id(), err)) + } + + // Some resources do not set the identifier until after creation + if d.Id() == "" { + d.SetId(aws.StringValue(output.ProgressEvent.Identifier)) + } + + return resourceAwsCloudFormationResourceRead(ctx, d, meta) +} + +func resourceAwsCloudFormationResourceRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + conn := meta.(*AWSClient).cfconn + + input := &cloudformation.GetResourceInput{ + Identifier: aws.String(d.Id()), + } + + if v, ok := d.GetOk("role_arn"); ok { + input.RoleArn = aws.String(v.(string)) + } + + if v, ok := d.GetOk("type_name"); ok { + input.TypeName = aws.String(v.(string)) + } + + if v, ok := d.GetOk("type_version_id"); ok { + input.TypeVersionId = aws.String(v.(string)) + } + + output, err := conn.GetResourceWithContext(ctx, input) + + if tfawserr.ErrCodeEquals(err, cloudformation.ErrCodeResourceNotFoundException) { + if d.IsNewResource() { + return diag.FromErr(fmt.Errorf("error reading CloudFormation Resource (%s): not found after creation", d.Id())) + } + + log.Printf("[WARN] CloudFormation Resource (%s) not found, removing from state", d.Id()) + d.SetId("") + return nil + } + + if err != nil { + return diag.FromErr(fmt.Errorf("error reading CloudFormation Resource (%s): %w", d.Id(), err)) + } + + if output == nil || output.ResourceDescription == nil { + return diag.FromErr(fmt.Errorf("error reading CloudFormation Resource (%s): empty response", d.Id())) + } + + d.Set("resource_model", output.ResourceDescription.ResourceModel) + + return nil +} + +func resourceAwsCloudFormationResourceUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + conn := meta.(*AWSClient).cfconn + + if d.HasChange("desired_state") { + oldRaw, newRaw := d.GetChange("desired_state") + + patchOperations, err := cfjsonpatch.PatchOperations(oldRaw, newRaw) + + if err != nil { + return diag.Diagnostics{ + { + Severity: diag.Error, + Summary: "JSON Patch Creation Unsuccessful", + Detail: fmt.Sprintf("Creating JSON Patch failed: %s", err.Error()), + }, + } + } + + input := &cloudformation.UpdateResourceInput{ + ClientToken: aws.String(resource.UniqueId()), + Identifier: aws.String(d.Id()), + PatchOperations: patchOperations, + } + + if v, ok := d.GetOk("role_arn"); ok { + input.RoleArn = aws.String(v.(string)) + } + + if v, ok := d.GetOk("type_name"); ok { + input.TypeName = aws.String(v.(string)) + } + + if v, ok := d.GetOk("type_version_id"); ok { + input.TypeVersionId = aws.String(v.(string)) + } + + output, err := conn.UpdateResourceWithContext(ctx, input) + + if err != nil { + return diag.FromErr(fmt.Errorf("error updating CloudFormation Resource (%s): %w", d.Id(), err)) + } + + if output == nil || output.ProgressEvent == nil { + return diag.FromErr(fmt.Errorf("error updating CloudFormation Resource (%s): empty reponse", d.Id())) + } + + if _, err := waiter.ResourceRequestStatusProgressEventOperationStatusSuccess(ctx, conn, aws.StringValue(output.ProgressEvent.RequestToken), d.Timeout(schema.TimeoutDelete)); err != nil { + return diag.FromErr(fmt.Errorf("error waiting for CloudFormation Resource (%s) update: %w", d.Id(), err)) + } + } + + return resourceAwsCloudFormationResourceRead(ctx, d, meta) +} + +func resourceAwsCloudFormationResourceDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + conn := meta.(*AWSClient).cfconn + + input := &cloudformation.DeleteResourceInput{ + ClientToken: aws.String(resource.UniqueId()), + Identifier: aws.String(d.Id()), + } + + if v, ok := d.GetOk("role_arn"); ok { + input.RoleArn = aws.String(v.(string)) + } + + if v, ok := d.GetOk("type_name"); ok { + input.TypeName = aws.String(v.(string)) + } + + if v, ok := d.GetOk("type_version_id"); ok { + input.TypeVersionId = aws.String(v.(string)) + } + + output, err := conn.DeleteResourceWithContext(ctx, input) + + if err != nil { + return diag.FromErr(fmt.Errorf("error deleting CloudFormation Resource (%s): %w", d.Id(), err)) + } + + if output == nil || output.ProgressEvent == nil { + return diag.FromErr(fmt.Errorf("error deleting CloudFormation Resource (%s): empty response", d.Id())) + } + + progressEvent, err := waiter.ResourceRequestStatusProgressEventOperationStatusSuccess(ctx, conn, aws.StringValue(output.ProgressEvent.RequestToken), d.Timeout(schema.TimeoutDelete)) + + if progressEvent != nil && aws.StringValue(progressEvent.ErrorCode) == cloudformation.HandlerErrorCodeNotFound { + return nil + } + + if err != nil { + return diag.FromErr(fmt.Errorf("error waiting for CloudFormation Resource (%s) deletion: %w", d.Id(), err)) + } + + return nil +} + +func resourceAwsCloudFormationResourceCustomizeDiffGetSchema(ctx context.Context, diff *schema.ResourceDiff, meta interface{}) error { + conn := meta.(*AWSClient).cfconn + + resourceSchema := diff.Get("schema").(string) + typeName := diff.Get("type_name").(string) + + if resourceSchema != "" { + return nil + } + + input := &cloudformation.DescribeTypeInput{ + Type: aws.String(cloudformation.RegistryTypeResource), + TypeName: aws.String(typeName), + } + + output, err := conn.DescribeTypeWithContext(ctx, input) + + if err != nil { + return fmt.Errorf("error describing CloudFormation Type (%s): %w", typeName, err) + } + + if output == nil { + return fmt.Errorf("error describing CloudFormation Type (%s): empty reponse", typeName) + } + + if err := diff.SetNew("schema", aws.StringValue(output.Schema)); err != nil { + return fmt.Errorf("error setting schema diff: %w", err) + } + + return nil +} + +func resourceAwsCloudFormationResourceCustomizeDiffSchemaDiff(ctx context.Context, diff *schema.ResourceDiff, meta interface{}) error { + oldDesiredStateRaw, newDesiredStateRaw := diff.GetChange("desired_state") + newSchema := diff.Get("schema").(string) + + newDesiredState, ok := newDesiredStateRaw.(string) + + if !ok { + return fmt.Errorf("unexpected new desired_state value type: %T", newDesiredStateRaw) + } + + // desired_state can be empty if unknown + if newDesiredState == "" { + return nil + } + + cfResourceSchema, err := cfschema.NewResourceJsonSchemaDocument(newSchema) + + if err != nil { + return fmt.Errorf("error parsing CloudFormation Resource Schema JSON: %w", err) + } + + if err := cfResourceSchema.ValidateConfigurationDocument(newDesiredState); err != nil { + return fmt.Errorf("error validating desired_state against CloudFormation Resource Schema: %w", err) + } + + // Do nothing further for new resources or if desired state is not changed + if diff.Id() == "" || !diff.HasChange("desired_state") { + return nil + } + + cfResource, err := cfResourceSchema.Resource() + + if err != nil { + return fmt.Errorf("error converting CloudFormation Resource Schema JSON: %w", err) + } + + patchOperations, err := cfjsonpatch.PatchOperations(oldDesiredStateRaw, newDesiredStateRaw) + + if err != nil { + return fmt.Errorf("error creating desired_state JSON Patch: %w", err) + } + + for _, patchOperation := range patchOperations { + if patchOperation == nil { + continue + } + + if cfResource.IsCreateOnlyPropertyPath(aws.StringValue(patchOperation.Path)) { + if err := diff.ForceNew("desired_state"); err != nil { + return fmt.Errorf("error setting desired_state ForceNew: %w", err) + } + + break + } + } + + return nil +} diff --git a/aws/resource_aws_cloudformation_resource_test.go b/aws/resource_aws_cloudformation_resource_test.go new file mode 100644 index 00000000000..e2dbce3c8dc --- /dev/null +++ b/aws/resource_aws_cloudformation_resource_test.go @@ -0,0 +1,664 @@ +package aws + +import ( + "fmt" + "regexp" + "testing" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/cloudformation" + "github.com/hashicorp/aws-sdk-go-base/tfawserr" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" +) + +func TestAccAwsCloudformationResource_basic(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_cloudformation_resource.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), + ProviderFactories: testAccProviderFactories, + CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAwsCloudformationResourceConfig(rName), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`^\{.*\}$`)), + resource.TestMatchResourceAttr(resourceName, "schema", regexp.MustCompile(`^\{.*`)), + ), + }, + }, + }) +} + +func TestAccAwsCloudformationResource_disappears(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_cloudformation_resource.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), + ProviderFactories: testAccProviderFactories, + CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAwsCloudformationResourceConfig(rName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckResourceDisappears(testAccProvider, resourceAwsCloudFormationResource(), resourceName), + ), + ExpectNonEmptyPlan: true, + }, + }, + }) +} + +func TestAccAwsCloudformationResource_DesiredState_BooleanValueAdded(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_cloudformation_resource.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), + ProviderFactories: testAccProviderFactories, + CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAwsCloudformationResourceConfigDesiredStateBooleanValueRemoved(rName), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"Enabled":false`)), + ), + }, + { + Config: testAccAwsCloudformationResourceConfigDesiredStateBooleanValue(rName, true), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"Enabled":true`)), + ), + }, + }, + }) +} + +func TestAccAwsCloudformationResource_DesiredState_BooleanValueRemoved(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_cloudformation_resource.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), + ProviderFactories: testAccProviderFactories, + CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAwsCloudformationResourceConfigDesiredStateBooleanValue(rName, true), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"Enabled":true`)), + ), + }, + { + Config: testAccAwsCloudformationResourceConfigDesiredStateBooleanValueRemoved(rName), + Check: resource.ComposeAggregateTestCheckFunc( + // JSON patch operation is submitted, but CloudFormation does not revert value to property default + resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"Enabled":true`)), + ), + }, + }, + }) +} + +func TestAccAwsCloudformationResource_DesiredState_BooleanValueUpdate(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_cloudformation_resource.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), + ProviderFactories: testAccProviderFactories, + CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAwsCloudformationResourceConfigDesiredStateBooleanValue(rName, true), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"Enabled":true`)), + ), + }, + { + Config: testAccAwsCloudformationResourceConfigDesiredStateBooleanValue(rName, false), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"Enabled":false`)), + ), + }, + }, + }) +} + +func TestAccAwsCloudformationResource_DesiredState_CreateOnly(t *testing.T) { + rName1 := acctest.RandomWithPrefix("tf-acc-test") + rName2 := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_cloudformation_resource.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), + ProviderFactories: testAccProviderFactories, + CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAwsCloudformationResourceConfigDesiredStateCreateOnly(rName1), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"LogGroupName":"`+rName1+`"`)), + ), + }, + { + Config: testAccAwsCloudformationResourceConfigDesiredStateCreateOnly(rName2), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"LogGroupName":"`+rName2+`"`)), + ), + }, + }, + }) +} + +func TestAccAwsCloudformationResource_DesiredState_IntegerValueAdded(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_cloudformation_resource.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), + ProviderFactories: testAccProviderFactories, + CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAwsCloudformationResourceConfigDesiredStateIntegerValueRemoved(rName), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"LogGroupName":`)), + ), + }, + { + Config: testAccAwsCloudformationResourceConfigDesiredStateIntegerValue(rName, 14), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"RetentionInDays":14`)), + ), + }, + }, + }) +} + +func TestAccAwsCloudformationResource_DesiredState_IntegerValueRemoved(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_cloudformation_resource.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), + ProviderFactories: testAccProviderFactories, + CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAwsCloudformationResourceConfigDesiredStateIntegerValue(rName, 14), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"RetentionInDays":14`)), + ), + }, + { + Config: testAccAwsCloudformationResourceConfigDesiredStateIntegerValueRemoved(rName), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"LogGroupName":`)), + ), + }, + }, + }) +} + +func TestAccAwsCloudformationResource_DesiredState_IntegerValueUpdate(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_cloudformation_resource.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), + ProviderFactories: testAccProviderFactories, + CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAwsCloudformationResourceConfigDesiredStateIntegerValue(rName, 7), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"RetentionInDays":7`)), + ), + }, + { + Config: testAccAwsCloudformationResourceConfigDesiredStateIntegerValue(rName, 14), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"RetentionInDays":14`)), + ), + }, + }, + }) +} + +func TestAccAwsCloudformationResource_DesiredState_InvalidPropertyName(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), + ProviderFactories: testAccProviderFactories, + CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAwsCloudformationResourceConfigDesiredStateInvalidPropertyName(rName), + ExpectError: regexp.MustCompile(`\(root\): Additional property InvalidName is not allowed`), + }, + }, + }) +} + +func TestAccAwsCloudformationResource_DesiredState_InvalidPropertyValue(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), + ProviderFactories: testAccProviderFactories, + CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAwsCloudformationResourceConfigDesiredStateInvalidPropertyValue(rName), + ExpectError: regexp.MustCompile(`LogGroupName: Does not match pattern`), + }, + }, + }) +} + +func TestAccAwsCloudformationResource_DesiredState_ObjectValueAdded(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_cloudformation_resource.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), + ProviderFactories: testAccProviderFactories, + CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAwsCloudformationResourceConfigDesiredStateObjectValueRemoved(rName), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"Name":`)), + ), + }, + { + Config: testAccAwsCloudformationResourceConfigDesiredStateObjectValue1(rName, "key1", "value1"), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"Value":"value1"`)), + ), + }, + }, + }) +} + +func TestAccAwsCloudformationResource_DesiredState_ObjectValueRemoved(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_cloudformation_resource.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), + ProviderFactories: testAccProviderFactories, + CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAwsCloudformationResourceConfigDesiredStateObjectValue1(rName, "key1", "value1"), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"Value":"value1"`)), + ), + }, + { + Config: testAccAwsCloudformationResourceConfigDesiredStateObjectValueRemoved(rName), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"Name":`)), + ), + }, + }, + }) +} + +func TestAccAwsCloudformationResource_DesiredState_ObjectValueUpdate(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_cloudformation_resource.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), + ProviderFactories: testAccProviderFactories, + CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAwsCloudformationResourceConfigDesiredStateObjectValue1(rName, "key1", "value1"), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"Value":"value1"`)), + ), + }, + { + Config: testAccAwsCloudformationResourceConfigDesiredStateObjectValue1(rName, "key1", "value1updated"), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"Value":"value1updated"`)), + ), + }, + { + Config: testAccAwsCloudformationResourceConfigDesiredStateObjectValue1(rName, "key2", "value2"), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"Value":"value2"`)), + ), + }, + }, + }) +} + +func TestAccAwsCloudformationResource_DesiredState_StringValueAdded(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_cloudformation_resource.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), + ProviderFactories: testAccProviderFactories, + CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAwsCloudformationResourceConfigDesiredStateStringValueRemoved(rName), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"Name":`)), + ), + }, + { + Config: testAccAwsCloudformationResourceConfigDesiredStateStringValue(rName, "description1"), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"Description":"description1"`)), + ), + }, + }, + }) +} + +func TestAccAwsCloudformationResource_DesiredState_StringValueRemoved(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_cloudformation_resource.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), + ProviderFactories: testAccProviderFactories, + CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAwsCloudformationResourceConfigDesiredStateStringValue(rName, "description1"), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"Description":"description1"`)), + ), + }, + { + Config: testAccAwsCloudformationResourceConfigDesiredStateStringValueRemoved(rName), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"Name":`)), + ), + }, + }, + }) +} + +func TestAccAwsCloudformationResource_DesiredState_StringValueUpdate(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_cloudformation_resource.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), + ProviderFactories: testAccProviderFactories, + CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAwsCloudformationResourceConfigDesiredStateStringValue(rName, "description1"), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"Description":"description1"`)), + ), + }, + { + Config: testAccAwsCloudformationResourceConfigDesiredStateStringValue(rName, "description2"), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"Description":"description2"`)), + ), + }, + }, + }) +} + +func TestAccAwsCloudformationResource_ResourceSchema(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_cloudformation_resource.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), + ProviderFactories: testAccProviderFactories, + CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAwsCloudformationResourceConfigResourceSchema(rName), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttrPair(resourceName, "schema", "data.aws_cloudformation_type.test", "schema"), + ), + }, + }, + }) +} + +func testAccCheckAwsCloudformationResourceDestroy(s *terraform.State) error { + conn := testAccProvider.Meta().(*AWSClient).cfconn + + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_cloudformation_resource" { + continue + } + + input := &cloudformation.GetResourceInput{ + Identifier: aws.String(rs.Primary.ID), + TypeName: aws.String(rs.Primary.Attributes["type_name"]), + } + + _, err := conn.GetResource(input) + + if tfawserr.ErrCodeEquals(err, cloudformation.ErrCodeResourceNotFoundException) { + continue + } + + // Temporary: Some CloudFormation Resources do not correctly re-map + // "not found" errors, instead returning a HandlerFailureException. + // These should be reported and fixed upstream over time, but for now + // work around the issue only in CheckDestroy. + if tfawserr.ErrMessageContains(err, cloudformation.ErrCodeHandlerFailureException, "not found") { + continue + } + + if err != nil { + return fmt.Errorf("error reading CloudFormation Resource (%s): %w", rs.Primary.ID, err) + } + } + + return nil +} + +func testAccAwsCloudformationResourceConfig(rName string) string { + return fmt.Sprintf(` +resource "aws_cloudformation_resource" "test" { + type_name = "AWS::Logs::LogGroup" + + desired_state = jsonencode({ + LogGroupName = %[1]q + }) +} +`, rName) +} + +func testAccAwsCloudformationResourceConfigDesiredStateBooleanValue(rName string, booleanValue bool) string { + return fmt.Sprintf(` +resource "aws_cloudformation_resource" "test" { + type_name = "AWS::ApiGateway::ApiKey" + + desired_state = jsonencode({ + Enabled = %[2]t + Name = %[1]q + Value = %[1]q + }) +} +`, rName, booleanValue) +} + +func testAccAwsCloudformationResourceConfigDesiredStateBooleanValueRemoved(rName string) string { + return fmt.Sprintf(` +resource "aws_cloudformation_resource" "test" { + type_name = "AWS::ApiGateway::ApiKey" + + desired_state = jsonencode({ + Name = %[1]q + Value = %[1]q + }) +} +`, rName) +} + +func testAccAwsCloudformationResourceConfigDesiredStateCreateOnly(rName string) string { + return fmt.Sprintf(` +resource "aws_cloudformation_resource" "test" { + type_name = "AWS::Logs::LogGroup" + + desired_state = jsonencode({ + LogGroupName = %[1]q + }) +} +`, rName) +} + +func testAccAwsCloudformationResourceConfigDesiredStateIntegerValue(rName string, integerValue int) string { + return fmt.Sprintf(` +resource "aws_cloudformation_resource" "test" { + type_name = "AWS::Logs::LogGroup" + + desired_state = jsonencode({ + LogGroupName = %[1]q + RetentionInDays = %[2]d + }) +} +`, rName, integerValue) +} + +func testAccAwsCloudformationResourceConfigDesiredStateIntegerValueRemoved(rName string) string { + return fmt.Sprintf(` +resource "aws_cloudformation_resource" "test" { + type_name = "AWS::Logs::LogGroup" + + desired_state = jsonencode({ + LogGroupName = %[1]q + }) +} +`, rName) +} + +func testAccAwsCloudformationResourceConfigDesiredStateInvalidPropertyName(rName string) string { + return fmt.Sprintf(` +resource "aws_cloudformation_resource" "test" { + type_name = "AWS::Logs::LogGroup" + + desired_state = jsonencode({ + InvalidName = %[1]q + }) +} +`, rName) +} + +func testAccAwsCloudformationResourceConfigDesiredStateInvalidPropertyValue(rName string) string { + return fmt.Sprintf(` +resource "aws_cloudformation_resource" "test" { + type_name = "AWS::Logs::LogGroup" + + desired_state = jsonencode({ + LogGroupName = "%[1]s!exclamation-not-valid" + }) +} +`, rName) +} + +func testAccAwsCloudformationResourceConfigDesiredStateObjectValue1(rName string, key1 string, value1 string) string { + return fmt.Sprintf(` +resource "aws_cloudformation_resource" "test" { + type_name = "AWS::ECS::Cluster" + + desired_state = jsonencode({ + ClusterName = %[1]q + Tags = [ + { + Key = %[2]q + Value = %[3]q + } + ] + }) +} +`, rName, key1, value1) +} + +func testAccAwsCloudformationResourceConfigDesiredStateObjectValueRemoved(rName string) string { + return fmt.Sprintf(` +resource "aws_cloudformation_resource" "test" { + type_name = "AWS::ECS::Cluster" + + desired_state = jsonencode({ + ClusterName = %[1]q + }) +} +`, rName) +} + +func testAccAwsCloudformationResourceConfigDesiredStateStringValue(rName string, stringValue string) string { + return fmt.Sprintf(` +resource "aws_cloudformation_resource" "test" { + type_name = "AWS::Athena::WorkGroup" + + desired_state = jsonencode({ + Description = %[2]q + Name = %[1]q + }) +} +`, rName, stringValue) +} + +func testAccAwsCloudformationResourceConfigDesiredStateStringValueRemoved(rName string) string { + return fmt.Sprintf(` +resource "aws_cloudformation_resource" "test" { + type_name = "AWS::Athena::WorkGroup" + + desired_state = jsonencode({ + Name = %[1]q + }) +} +`, rName) +} + +func testAccAwsCloudformationResourceConfigResourceSchema(rName string) string { + return fmt.Sprintf(` +data "aws_cloudformation_type" "test" { + type = "RESOURCE" + type_name = "AWS::Logs::LogGroup" +} + +resource "aws_cloudformation_resource" "test" { + schema = data.aws_cloudformation_type.test.schema + type_name = data.aws_cloudformation_type.test.type_name + + desired_state = jsonencode({ + LogGroupName = %[1]q + }) +} +`, rName) +} diff --git a/go.mod b/go.mod index f4392b71a4e..7004cef4233 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,9 @@ require ( github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412 // indirect github.com/aws/aws-sdk-go v1.40.53 github.com/beevik/etree v1.1.0 + github.com/evanphx/json-patch v0.5.2 // indirect github.com/fatih/color v1.9.0 // indirect + github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.1.0 github.com/hashicorp/aws-sdk-go-base v1.0.0 github.com/hashicorp/go-cleanhttp v0.5.2 github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 @@ -15,6 +17,7 @@ require ( github.com/hashicorp/terraform-plugin-sdk/v2 v2.8.0 github.com/jen20/awspolicyequivalence v1.1.0 github.com/keybase/go-crypto v0.0.0-20161004153544-93f5b35093ba + github.com/mattbaird/jsonpatch v0.0.0-20200820163806-098863c1fc24 github.com/mattn/go-colorable v0.1.7 // indirect github.com/mitchellh/copystructure v1.2.0 github.com/mitchellh/go-homedir v1.1.0 @@ -25,4 +28,6 @@ require ( gopkg.in/yaml.v2 v2.4.0 ) +replace github.com/aws/aws-sdk-go => github.com/hashicorp/aws-sdk-go-private v1.38.23-0.20210420184552-ae24b9862457 + replace github.com/hashicorp/terraform-plugin-sdk/v2 => github.com/gdavison/terraform-plugin-sdk/v2 v2.7.1-0.20210913224932-c7c2dbd9e010 diff --git a/go.sum b/go.sum deleted file mode 100644 index e723f224900..00000000000 --- a/go.sum +++ /dev/null @@ -1,629 +0,0 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.61.0 h1:NLQf5e1OMspfNT1RAHOB3ublr1TW3YTXO8OiWwVjK2U= -cloud.google.com/go v0.61.0/go.mod h1:XukKJg4Y7QsUu0Hxg3qQKUWR4VuWivmyMK2+rUyxAqw= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0 h1:STgFzyU5/8miMl0//zKh2aQeTyeaUH3WN9bSUiJ09bA= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= -github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= -github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= -github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= -github.com/Microsoft/go-winio v0.4.16 h1:FtSW/jqD+l4ba5iPBj9CODVtgfYAD8w2wS923g/cFDk= -github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= -github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 h1:YoJbenK9C67SkzkDfmQuVln04ygHj3vjZfd9FL+GmQQ= -github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7/go.mod h1:z4/9nQmJSSwwds7ejkxaJwO37dru3geImFUdJlaLzQo= -github.com/acomagu/bufpipe v1.0.3 h1:fxAGrHZTgQ9w5QqVItgzwj235/uYZYgbXitB+dLupOk= -github.com/acomagu/bufpipe v1.0.3/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4= -github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= -github.com/agext/levenshtein v1.2.2 h1:0S/Yg6LYmFJ5stwQeRp6EeOcCbj7xiqQSdNelsXvaqE= -github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= -github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412 h1:w1UutsfOrms1J05zt7ISrnJIXKzwaspym5BTKGx93EI= -github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412/go.mod h1:WPjqKcmVOxf0XSf3YxCJs6N6AOSrOx3obionmG7T0y0= -github.com/andybalholm/crlf v0.0.0-20171020200849-670099aa064f/go.mod h1:k8feO4+kXDxro6ErPXBRTJ/ro2mf0SsFG8s7doP9kJE= -github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= -github.com/apparentlymart/go-cidr v1.0.1 h1:NmIwLZ/KdsjIUlhf+/Np40atNXm/+lZ5txfTJ/SpF+U= -github.com/apparentlymart/go-cidr v1.0.1/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/YjEn/vI25Lg7Gwc= -github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= -github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0 h1:MzVXffFUye+ZcSR6opIgz9Co7WcDx6ZcY+RjfFHoA0I= -github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= -github.com/apparentlymart/go-textseg v1.0.0 h1:rRmlIsPEEhUTIKQb7T++Nz/A5Q6C9IuX2wFoYVvnCs0= -github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= -github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= -github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw= -github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo= -github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM= -github.com/aws/aws-sdk-go v1.25.3/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.31.9/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= -github.com/aws/aws-sdk-go v1.40.53 h1:wi4UAslOQ1HfF2NjnIwI6st8n7sQg7shUUNLkaCgIpc= -github.com/aws/aws-sdk-go v1.40.53/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= -github.com/beevik/etree v1.1.0 h1:T0xke/WvNtMoCqgzPhkX2r4rjY3GDZFi+FjpRZY2Jbs= -github.com/beevik/etree v1.1.0/go.mod h1:r8Aw8JqVegEf0w2fDnATrX9VpkMcyFeM0FhwO62wh+A= -github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= -github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= -github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc h1:biVzkmvwrH8WK8raXaxBx6fRVTlJILwEwQGL1I/ByEI= -github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg= -github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s= -github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= -github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= -github.com/gdavison/terraform-plugin-sdk/v2 v2.7.1-0.20210913224932-c7c2dbd9e010 h1:05JaIuXKUa+nXrb/LUDvlGQ7qvAdxCCGiIf/XIv7sYA= -github.com/gdavison/terraform-plugin-sdk/v2 v2.7.1-0.20210913224932-c7c2dbd9e010/go.mod h1:O4vVRy2W0P3810kdyNmG4wKcm4wLX/arLxuxjPA1IpA= -github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= -github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4= -github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= -github.com/go-git/go-billy/v5 v5.2.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= -github.com/go-git/go-billy/v5 v5.3.1 h1:CPiOUAzKtMRvolEKw+bG1PLRpT7D3LIs3/3ey4Aiu34= -github.com/go-git/go-billy/v5 v5.3.1/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= -github.com/go-git/go-git-fixtures/v4 v4.2.1/go.mod h1:K8zd3kDUAykwTdDCr+I0per6Y6vMiRR/nnVTBtavnB0= -github.com/go-git/go-git/v5 v5.4.2 h1:BXyZu9t0VkbiHtqrsvdq39UDhGJTl1h55VW6CSC4aY4= -github.com/go-git/go-git/v5 v5.4.2/go.mod h1:gQ1kArt6d+n+BGd+/B/I74HwRTLhth2+zti4ihgckDc= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= -github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= -github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0 h1:pMen7vLs8nvgEYhywH3KDWJIJTeEr2ULsVWHWYHQyBs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/hashicorp/aws-sdk-go-base v1.0.0 h1:J7MMLOfSoDWkusy+cSzKYG1/aFyCzYJmdE0mod3/WLw= -github.com/hashicorp/aws-sdk-go-base v1.0.0/go.mod h1:2fRjWDv3jJBeN6mVWFHV6hFTNeFBx2gpDLQaZNxUVAY= -github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= -github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-checkpoint v0.5.0 h1:MFYpPZCnQqQTE18jFwSII6eUQrD/oxMFp3mlgcqk5mU= -github.com/hashicorp/go-checkpoint v0.5.0/go.mod h1:7nfLNL10NsxqO4iWuW6tWW0HjZuDrwkBuEQsVcpCOgg= -github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= -github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= -github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 h1:1/D3zfFHttUKaCaGKZ/dR2roBXv0vKbSCnssIldfQdI= -github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320/go.mod h1:EiZBMaudVLy8fmjf9Npq1dq9RalhveqZG5w/yz3mHWs= -github.com/hashicorp/go-getter v1.5.3 h1:NF5+zOlQegim+w/EUhSLh6QhXHmZMEeHLQzllkQ3ROU= -github.com/hashicorp/go-getter v1.5.3/go.mod h1:BrrV/1clo8cCYu6mxvboYg+KutTiFnXjMEgDD8+i7ZI= -github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= -github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-hclog v0.15.0 h1:qMuK0wxsoW4D0ddCCYwPSTm4KQv1X1ke3WmPWZ0Mvsk= -github.com/hashicorp/go-hclog v0.15.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= -github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= -github.com/hashicorp/go-plugin v1.3.0/go.mod h1:F9eH4LrE/ZsRdbwhfjs9k9HoDUwAHnYtXdgmf1AVNs0= -github.com/hashicorp/go-plugin v1.4.1 h1:6UltRQlLN9iZO513VveELp5xyaFxVD2+1OVylE+2E+w= -github.com/hashicorp/go-plugin v1.4.1/go.mod h1:5fGEH17QVwTTcR0zV7yhDPLLmFX9YSZ38b18Udy6vYQ= -github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= -github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I= -github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= -github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go-version v1.3.0 h1:McDWVJIU/y+u1BRV06dPaLfLCaT7fUTJLp5r04x7iNw= -github.com/hashicorp/go-version v1.3.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/hcl/v2 v2.3.0 h1:iRly8YaMwTBAKhn1Ybk7VSdzbnopghktCD031P8ggUE= -github.com/hashicorp/hcl/v2 v2.3.0/go.mod h1:d+FwDBbOLvpAM3Z6J7gPj/VoAGkNe/gm352ZhjJ/Zv8= -github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= -github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/terraform-exec v0.14.0 h1:UQoUcxKTZZXhyyK68Cwn4mApT4mnFPmEXPiqaHL9r+w= -github.com/hashicorp/terraform-exec v0.14.0/go.mod h1:qrAASDq28KZiMPDnQ02sFS9udcqEkRly002EA2izXTA= -github.com/hashicorp/terraform-json v0.12.0 h1:8czPgEEWWPROStjkWPUnTQDXmpmZPlkQAwYYLETaTvw= -github.com/hashicorp/terraform-json v0.12.0/go.mod h1:pmbq9o4EuL43db5+0ogX10Yofv1nozM+wskr/bGFJpI= -github.com/hashicorp/terraform-plugin-go v0.3.0 h1:AJqYzP52JFYl9NABRI7smXI1pNjgR5Q/y2WyVJ/BOZA= -github.com/hashicorp/terraform-plugin-go v0.3.0/go.mod h1:dFHsQMaTLpON2gWhVWT96fvtlc/MF1vSy3OdMhWBzdM= -github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= -github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d h1:kJCB4vdITiW1eC1vq2e6IsrXKrZit1bv/TDYFGMp4BQ= -github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= -github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= -github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= -github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= -github.com/jen20/awspolicyequivalence v1.1.0 h1:cn37D6o0lXLwqx2neCokGfaB3LLNSo5CrLMLGjY609g= -github.com/jen20/awspolicyequivalence v1.1.0/go.mod h1:PV1fS2xyHhCLp83vbgSMFr2drM4GzG61wkz+k4pOG3E= -github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= -github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE= -github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74= -github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik= -github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= -github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= -github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= -github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1 h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 h1:DowS9hvgyYSX4TO5NpyC606/Z4SxnNYbT+WX27or6Ck= -github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= -github.com/keybase/go-crypto v0.0.0-20161004153544-93f5b35093ba h1:NARVGAAgEXvoMeNPHhPFt1SBt1VMznA3Gnz9d0qj+co= -github.com/keybase/go-crypto v0.0.0-20161004153544-93f5b35093ba/go.mod h1:ghbZscTyKdM07+Fw3KSi0hcJm+AlEUWj8QLlPtijN/M= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.11.2 h1:MiK62aErc3gIiVEtyzKfeOHgW7atJb5g/KNX5m3c2nQ= -github.com/klauspost/compress v1.11.2/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= -github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.7 h1:bQGKb3vps/j0E9GfJQ03JyhRuxsvdAanXlT9BTw3mdw= -github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= -github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= -github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mitchellh/cli v1.1.2/go.mod h1:6iaV0fGdElS6dPBx0EApTxHrcWvmJphyh2n8YBLPPZ4= -github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= -github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= -github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= -github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/go-testing-interface v1.0.4/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= -github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= -github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= -github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4= -github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= -github.com/mitchellh/mapstructure v1.0.0/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= -github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nsf/jsondiff v0.0.0-20200515183724-f29ed568f4ce h1:RPclfga2SEJmgMmz2k+Mg7cowZ8yv4Trqw9UsJby758= -github.com/nsf/jsondiff v0.0.0-20200515183724-f29ed568f4ce/go.mod h1:uFMI8w+ref4v2r9jz+c9i1IfIttS/OkmLfrk1jne5hs= -github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= -github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= -github.com/pquerna/otp v1.3.0 h1:oJV/SkzR33anKXwQU3Of42rL4wbrffP4uvUf1SvS5Xs= -github.com/pquerna/otp v1.3.0/go.mod h1:dkJfzwRKNiegxyNb54X/3fLwhCynbMspSyWKnvi1AEg= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/sebdah/goldie v1.0.0/go.mod h1:jXP4hmWywNEwZzhMuv2ccnqTSFpuq8iyQhtQdkkZBH4= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= -github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= -github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= -github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= -github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= -github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= -github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/ulikunitz/xz v0.5.8 h1:ERv8V6GKqVi23rgu5cj9pVfVzJbOqAY2Ntl88O6c2nQ= -github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= -github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= -github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI= -github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= -github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4= -github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= -github.com/xanzy/ssh-agent v0.3.0 h1:wUMzuKtKilRgBAD1sUb8gOwwRr2FGoBVumcjoOACClI= -github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= -github.com/zclconf/go-cty v1.2.1/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= -github.com/zclconf/go-cty v1.8.4 h1:pwhhz5P+Fjxse7S7UriBrMu6AUJSZM5pKqGem1PjGAs= -github.com/zclconf/go-cty v1.8.4/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= -github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4 h1:LYy1Hy3MJdrCdMwwzxA/dRok4ejH+RwNGbuoD9fCjto= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b h1:7mWr3k41Qtv8XlltBkDkl8LoP3mpSgBW8BUoxtEdbXg= -golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/net v0.0.0-20180530234432-1e491301e022/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k= -golang.org/x/net v0.0.0-20210614182718-04defd469f4e h1:XpT3nA5TvE525Ne3hInMh6+GETgn27Zfm9dxsThnX2Q= -golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210502180810-71e4cd670f79 h1:RX8C8PRZc2hTIod4ds8ij+/4RQX3AqhYj3uOHmyaz4E= -golang.org/x/sys v0.0.0-20210502180810-71e4cd670f79/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200713011307-fd294ab11aed h1:+qzWo37K31KxduIYaBeMqJ8MUOyTayOQKpH9aDPLMSY= -golang.org/x/tools v0.0.0-20200713011307-fd294ab11aed/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0 h1:BaiDisFir8O4IJxvAabCGGkQ6yCJegNQqSVoYUNAnbk= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20170818010345-ee236bd376b0/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200711021454-869866162049 h1:YFTFpQhgvrLrmxtiIncJxFXeCyq84ixuKWVCaCAi9Oc= -google.golang.org/genproto v0.0.0-20200711021454-869866162049/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.32.0 h1:zWTV+LMdc3kaiJMSTOFz2UgSBgx8RNQoTGiZu3fR9S0= -google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= -google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= -google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= -gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/website/docs/r/cloudformation_resource.html.markdown b/website/docs/r/cloudformation_resource.html.markdown new file mode 100644 index 00000000000..1ec29ba778c --- /dev/null +++ b/website/docs/r/cloudformation_resource.html.markdown @@ -0,0 +1,48 @@ +--- +subcategory: "CloudFormation" +layout: "aws" +page_title: "AWS: aws_cloudformation_resource" +description: |- + Manages a CloudFormation Resource. +--- + +# Resource: aws_cloudformation_resource + +Manages a CloudFormation Resource. The configuration and lifecycle handling of these resources is proxied through CloudFormation handlers to the backend service. + +## Example Usage + +```terraform +resource "aws_cloudformation_resource" "example" { + type_name = "AWS::ECS::Cluster" + + desired_state = jsonencode({ + ClusterName = "example" + Tags = [ + { + Key = "CostCenter" + Value = "IT" + } + ] + }) +} +``` + +## Argument Reference + +The following arguments are required: + +* `desired_state` - (Required) JSON matching the CloudFormation resource type schema with desired configuration. +* `type_name` - (Required) CloudFormation resource type name. For example, `AWS::EC2::VPC`. +* `type_version_id` - (Required) Identifier of the CloudFormation resource type version. + +The following arguments are optional: + +* `role_arn` - (Optional) Amazon Resource Name (ARN) of the IAM Role to assume for operations. +* `schema` - (Optional) JSON of the CloudFormation resource type schema. Automatically fetched if not provided. This value is marked sensitive only to prevent large plan differences from showing. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `resource_model` - JSON matching the CloudFormation resource type schema with current configuration. From cc841e498c46981fe255d3180d4d1ebdf4dcbc69 Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Wed, 21 Apr 2021 10:50:03 -0400 Subject: [PATCH 02/33] docs/resource/aws_cloudformation_resource: Clarify schema argument usage --- website/docs/r/cloudformation_resource.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/cloudformation_resource.html.markdown b/website/docs/r/cloudformation_resource.html.markdown index 1ec29ba778c..6e5cfb48ace 100644 --- a/website/docs/r/cloudformation_resource.html.markdown +++ b/website/docs/r/cloudformation_resource.html.markdown @@ -39,7 +39,7 @@ The following arguments are required: The following arguments are optional: * `role_arn` - (Optional) Amazon Resource Name (ARN) of the IAM Role to assume for operations. -* `schema` - (Optional) JSON of the CloudFormation resource type schema. Automatically fetched if not provided. This value is marked sensitive only to prevent large plan differences from showing. +* `schema` - (Optional) JSON of the CloudFormation resource type schema which is used for plan time validation where possible. Automatically fetched if not provided. In large scale environments with multiple resources using the same `type_name`, it is recommended to fetch the schema once via the [`aws_cloudformation_type` data source](/docs/providers/aws/d/cloudformation_type.html) and use this argument to reduce `DescribeType` API operation throttling. This value is marked sensitive only to prevent large plan differences from showing. ## Attributes Reference From 2ce57400a8cc040a7c37379adce825de8dcf7783 Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Wed, 21 Apr 2021 11:18:16 -0400 Subject: [PATCH 03/33] New Data Source: aws_cloudformation_resource Output from acceptance testing: ``` --- PASS: TestAccCloudformationResourceDataSource_basic (39.25s) ``` --- ...data_source_aws_cloudformation_resource.go | 81 +++++++++++++++++++ ...source_aws_cloudformation_resource_test.go | 50 ++++++++++++ aws/provider.go | 1 + .../d/cloudformation_resource.html.markdown | 38 +++++++++ 4 files changed, 170 insertions(+) create mode 100644 aws/data_source_aws_cloudformation_resource.go create mode 100644 aws/data_source_aws_cloudformation_resource_test.go create mode 100644 website/docs/d/cloudformation_resource.html.markdown diff --git a/aws/data_source_aws_cloudformation_resource.go b/aws/data_source_aws_cloudformation_resource.go new file mode 100644 index 00000000000..d41292d5ea2 --- /dev/null +++ b/aws/data_source_aws_cloudformation_resource.go @@ -0,0 +1,81 @@ +package aws + +import ( + "context" + "fmt" + "regexp" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/cloudformation" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" +) + +func dataSourceAwsCloudFormationResource() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceAwsCloudformationResourceRead, + + Schema: map[string]*schema.Schema{ + "identifier": { + Type: schema.TypeString, + Required: true, + }, + "resource_model": { + Type: schema.TypeString, + Computed: true, + }, + "role_arn": { + Type: schema.TypeString, + Optional: true, + }, + "type_name": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringMatch(regexp.MustCompile(`[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}`), "must be three alphanumeric sections separated by double colons (::)"), + }, + "type_version_id": { + Type: schema.TypeString, + Optional: true, + }, + }, + } +} + +func dataSourceAwsCloudformationResourceRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + conn := meta.(*AWSClient).cfconn + + input := &cloudformation.GetResourceInput{} + + if v, ok := d.GetOk("identifier"); ok { + input.Identifier = aws.String(v.(string)) + } + + if v, ok := d.GetOk("role_arn"); ok { + input.RoleArn = aws.String(v.(string)) + } + + if v, ok := d.GetOk("type_name"); ok { + input.TypeName = aws.String(v.(string)) + } + + if v, ok := d.GetOk("type_version_id"); ok { + input.TypeVersionId = aws.String(v.(string)) + } + + output, err := conn.GetResourceWithContext(ctx, input) + + if err != nil { + return diag.FromErr(fmt.Errorf("error reading CloudFormation Resource: %w", err)) + } + + if output == nil || output.ResourceDescription == nil { + return diag.FromErr(fmt.Errorf("error reading CloudFormation Resource: empty response")) + } + + d.SetId(aws.StringValue(output.ResourceDescription.Identifier)) + + d.Set("resource_model", output.ResourceDescription.ResourceModel) + + return nil +} diff --git a/aws/data_source_aws_cloudformation_resource_test.go b/aws/data_source_aws_cloudformation_resource_test.go new file mode 100644 index 00000000000..c90638567da --- /dev/null +++ b/aws/data_source_aws_cloudformation_resource_test.go @@ -0,0 +1,50 @@ +package aws + +import ( + "fmt" + "testing" + + "github.com/aws/aws-sdk-go/service/cloudformation" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" +) + +func TestAccCloudformationResourceDataSource_basic(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + dataSourceName := "data.aws_cloudformation_resource.test" + resourceName := "aws_cloudformation_resource.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), + ProviderFactories: testAccProviderFactories, + CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAwsCloudformationResourceDataSourceConfig(rName), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttrPair(dataSourceName, "id", resourceName, "id"), + resource.TestCheckResourceAttrPair(dataSourceName, "resource_model", resourceName, "resource_model"), + resource.TestCheckResourceAttrPair(dataSourceName, "type_name", resourceName, "type_name"), + ), + }, + }, + }) +} + +func testAccAwsCloudformationResourceDataSourceConfig(rName string) string { + return fmt.Sprintf(` +resource "aws_cloudformation_resource" "test" { + type_name = "AWS::Logs::LogGroup" + + desired_state = jsonencode({ + LogGroupName = %[1]q + }) +} + +data "aws_cloudformation_resource" "test" { + identifier = aws_cloudformation_resource.test.id + type_name = aws_cloudformation_resource.test.type_name +} +`, rName) +} diff --git a/aws/provider.go b/aws/provider.go index 1b25a703a24..ad16b087a2b 100644 --- a/aws/provider.go +++ b/aws/provider.go @@ -218,6 +218,7 @@ func Provider() *schema.Provider { "aws_caller_identity": dataSourceAwsCallerIdentity(), "aws_canonical_user_id": dataSourceAwsCanonicalUserId(), "aws_cloudformation_export": dataSourceAwsCloudFormationExport(), + "aws_cloudformation_resource": dataSourceAwsCloudFormationResource(), "aws_cloudformation_stack": dataSourceAwsCloudFormationStack(), "aws_cloudformation_type": dataSourceAwsCloudFormationType(), "aws_cloudfront_cache_policy": dataSourceAwsCloudFrontCachePolicy(), diff --git a/website/docs/d/cloudformation_resource.html.markdown b/website/docs/d/cloudformation_resource.html.markdown new file mode 100644 index 00000000000..e0bada81630 --- /dev/null +++ b/website/docs/d/cloudformation_resource.html.markdown @@ -0,0 +1,38 @@ +--- +subcategory: "CloudFormation" +layout: "aws" +page_title: "AWS: aws_cloudformation_resource" +description: |- + Provides details for a CloudFormation Resource. +--- + +# Data Source: aws_cloudformation_resource + +Provides details for a CloudFormation Resource. The reading of these resources is proxied through CloudFormation handlers to the backend service. + +## Example Usage + +```terraform +resource "aws_cloudformation_resource" "example" { + identifier = "example" + type_name = "AWS::ECS::Cluster" +} +``` + +## Argument Reference + +The following arguments are required: + +* `identifier` - (Required) "Identifier of the CloudFormation resource type. For example, `vpc-12345678`." +* `type_name` - (Required) CloudFormation resource type name. For example, `AWS::EC2::VPC`. + +The following arguments are optional: + +* `role_arn` - (Optional) Amazon Resource Name (ARN) of the IAM Role to assume for operations. +* `type_version_id` - (Optional) Identifier of the CloudFormation resource type version. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `resource_model` - JSON matching the CloudFormation resource type schema with current configuration. From 8e85ac67ef328cdf480a744edba6507e55ec3a84 Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Wed, 21 Apr 2021 11:24:39 -0400 Subject: [PATCH 04/33] service/cloudformation: Various docs and tests improvements --- aws/data_source_aws_cloudformation_resource_test.go | 2 +- website/docs/d/cloudformation_resource.html.markdown | 6 +++--- website/docs/r/cloudformation_resource.html.markdown | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/aws/data_source_aws_cloudformation_resource_test.go b/aws/data_source_aws_cloudformation_resource_test.go index c90638567da..b3271b73bf7 100644 --- a/aws/data_source_aws_cloudformation_resource_test.go +++ b/aws/data_source_aws_cloudformation_resource_test.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) -func TestAccCloudformationResourceDataSource_basic(t *testing.T) { +func TestAccAwsCloudformationResourceDataSource_basic(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") dataSourceName := "data.aws_cloudformation_resource.test" resourceName := "aws_cloudformation_resource.test" diff --git a/website/docs/d/cloudformation_resource.html.markdown b/website/docs/d/cloudformation_resource.html.markdown index e0bada81630..4985c6ef61f 100644 --- a/website/docs/d/cloudformation_resource.html.markdown +++ b/website/docs/d/cloudformation_resource.html.markdown @@ -13,7 +13,7 @@ Provides details for a CloudFormation Resource. The reading of these resources i ## Example Usage ```terraform -resource "aws_cloudformation_resource" "example" { +data "aws_cloudformation_resource" "example" { identifier = "example" type_name = "AWS::ECS::Cluster" } @@ -23,7 +23,7 @@ resource "aws_cloudformation_resource" "example" { The following arguments are required: -* `identifier` - (Required) "Identifier of the CloudFormation resource type. For example, `vpc-12345678`." +* `identifier` - (Required) Identifier of the CloudFormation resource type. For example, `vpc-12345678`. * `type_name` - (Required) CloudFormation resource type name. For example, `AWS::EC2::VPC`. The following arguments are optional: @@ -35,4 +35,4 @@ The following arguments are optional: In addition to all arguments above, the following attributes are exported: -* `resource_model` - JSON matching the CloudFormation resource type schema with current configuration. +* `resource_model` - JSON string matching the CloudFormation resource type schema with current configuration. Underlying attributes can be referenced via the [`jsondecode()` function](https://www.terraform.io/docs/language/functions/jsondecode.html), for example, `jsondecode(data.aws_cloudformation_resource.example.resource_model)["example"]`. diff --git a/website/docs/r/cloudformation_resource.html.markdown b/website/docs/r/cloudformation_resource.html.markdown index 6e5cfb48ace..445cacad5da 100644 --- a/website/docs/r/cloudformation_resource.html.markdown +++ b/website/docs/r/cloudformation_resource.html.markdown @@ -32,17 +32,17 @@ resource "aws_cloudformation_resource" "example" { The following arguments are required: -* `desired_state` - (Required) JSON matching the CloudFormation resource type schema with desired configuration. +* `desired_state` - (Required) JSON string matching the CloudFormation resource type schema with desired configuration. Terraform configuration expressions can be converted into JSON using the [`jsonencode()` function](https://www.terraform.io/docs/language/functions/jsonencode.html). * `type_name` - (Required) CloudFormation resource type name. For example, `AWS::EC2::VPC`. -* `type_version_id` - (Required) Identifier of the CloudFormation resource type version. The following arguments are optional: * `role_arn` - (Optional) Amazon Resource Name (ARN) of the IAM Role to assume for operations. -* `schema` - (Optional) JSON of the CloudFormation resource type schema which is used for plan time validation where possible. Automatically fetched if not provided. In large scale environments with multiple resources using the same `type_name`, it is recommended to fetch the schema once via the [`aws_cloudformation_type` data source](/docs/providers/aws/d/cloudformation_type.html) and use this argument to reduce `DescribeType` API operation throttling. This value is marked sensitive only to prevent large plan differences from showing. +* `schema` - (Optional) JSON string of the CloudFormation resource type schema which is used for plan time validation where possible. Automatically fetched if not provided. In large scale environments with multiple resources using the same `type_name`, it is recommended to fetch the schema once via the [`aws_cloudformation_type` data source](/docs/providers/aws/d/cloudformation_type.html) and use this argument to reduce `DescribeType` API operation throttling. This value is marked sensitive only to prevent large plan differences from showing. +* `type_version_id` - (Optional) Identifier of the CloudFormation resource type version. ## Attributes Reference In addition to all arguments above, the following attributes are exported: -* `resource_model` - JSON matching the CloudFormation resource type schema with current configuration. +* `resource_model` - JSON string matching the CloudFormation resource type schema with current configuration. Underlying attributes can be referenced via the [`jsondecode()` function](https://www.terraform.io/docs/language/functions/jsondecode.html), for example, `jsondecode(data.aws_cloudformation_resource.example.resource_model)["example"]`. From 50514fa40f9dae6710cd9e01333d41de9e41243b Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Wed, 21 Apr 2021 11:27:50 -0400 Subject: [PATCH 05/33] tests/resource/aws_cloudformation_resource: Fix terrafmt issue --- aws/resource_aws_cloudformation_resource_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aws/resource_aws_cloudformation_resource_test.go b/aws/resource_aws_cloudformation_resource_test.go index e2dbce3c8dc..85c2306d5ee 100644 --- a/aws/resource_aws_cloudformation_resource_test.go +++ b/aws/resource_aws_cloudformation_resource_test.go @@ -522,8 +522,8 @@ resource "aws_cloudformation_resource" "test" { type_name = "AWS::ApiGateway::ApiKey" desired_state = jsonencode({ - Name = %[1]q - Value = %[1]q + Name = %[1]q + Value = %[1]q }) } `, rName) From f3b722c912c419235a5a29e05fb216c98198aa3e Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Thu, 22 Apr 2021 10:54:32 -0400 Subject: [PATCH 06/33] resource/aws_cloudformation_resource: Use pointer type in SetNew() Output from acceptance testing: ``` --- PASS: TestAccAwsCloudformationResource_DesiredState_InvalidPropertyName (7.59s) --- PASS: TestAccAwsCloudformationResource_DesiredState_InvalidPropertyValue (7.74s) --- PASS: TestAccAwsCloudformationResource_ResourceSchema (31.22s) --- PASS: TestAccAwsCloudformationResource_basic (33.56s) --- PASS: TestAccAwsCloudformationResource_disappears (36.86s) --- PASS: TestAccAwsCloudformationResource_DesiredState_IntegerValueAdded (50.77s) --- PASS: TestAccAwsCloudformationResourceDataSource_basic (51.70s) --- PASS: TestAccAwsCloudformationResource_DesiredState_IntegerValueUpdate (56.02s) --- PASS: TestAccAwsCloudformationResource_DesiredState_IntegerValueRemoved (62.38s) --- PASS: TestAccAwsCloudformationResource_DesiredState_BooleanValueAdded (62.46s) --- PASS: TestAccAwsCloudformationResource_DesiredState_StringValueUpdate (65.68s) --- PASS: TestAccAwsCloudformationResource_DesiredState_BooleanValueUpdate (67.40s) --- PASS: TestAccAwsCloudformationResource_DesiredState_StringValueAdded (70.97s) --- PASS: TestAccAwsCloudformationResource_DesiredState_BooleanValueRemoved (72.22s) --- PASS: TestAccAwsCloudformationResource_DesiredState_ObjectValueAdded (72.29s) --- PASS: TestAccAwsCloudformationResource_DesiredState_ObjectValueRemoved (79.59s) --- PASS: TestAccAwsCloudformationResource_DesiredState_CreateOnly (79.87s) --- PASS: TestAccAwsCloudformationResource_DesiredState_StringValueRemoved (81.09s) --- PASS: TestAccAwsCloudformationResource_DesiredState_ObjectValueUpdate (82.10s) ``` --- aws/resource_aws_cloudformation_resource.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/resource_aws_cloudformation_resource.go b/aws/resource_aws_cloudformation_resource.go index 5e01a534583..6d588b6a510 100644 --- a/aws/resource_aws_cloudformation_resource.go +++ b/aws/resource_aws_cloudformation_resource.go @@ -290,7 +290,7 @@ func resourceAwsCloudFormationResourceCustomizeDiffGetSchema(ctx context.Context return fmt.Errorf("error describing CloudFormation Type (%s): empty reponse", typeName) } - if err := diff.SetNew("schema", aws.StringValue(output.Schema)); err != nil { + if err := diff.SetNew("schema", output.Schema); err != nil { return fmt.Errorf("error setting schema diff: %w", err) } From 5d7f1e7a1ae41b37dba1a9a8099d2cad615a3109 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 20 Jul 2021 16:56:43 -0400 Subject: [PATCH 07/33] Use 'https://github.com/hashicorp/aws-sdk-go-private/tree/f-cloudapi-20210715'. --- go.mod | 2 +- go.sum | 599 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 600 insertions(+), 1 deletion(-) create mode 100644 go.sum diff --git a/go.mod b/go.mod index 7004cef4233..6908d0cfc22 100644 --- a/go.mod +++ b/go.mod @@ -28,6 +28,6 @@ require ( gopkg.in/yaml.v2 v2.4.0 ) -replace github.com/aws/aws-sdk-go => github.com/hashicorp/aws-sdk-go-private v1.38.23-0.20210420184552-ae24b9862457 +replace github.com/aws/aws-sdk-go => github.com/hashicorp/aws-sdk-go-private v1.39.2-0.20210716172600-daec78152c52 replace github.com/hashicorp/terraform-plugin-sdk/v2 => github.com/gdavison/terraform-plugin-sdk/v2 v2.7.1-0.20210913224932-c7c2dbd9e010 diff --git a/go.sum b/go.sum new file mode 100644 index 00000000000..9c6484c5b26 --- /dev/null +++ b/go.sum @@ -0,0 +1,599 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.61.0 h1:NLQf5e1OMspfNT1RAHOB3ublr1TW3YTXO8OiWwVjK2U= +cloud.google.com/go v0.61.0/go.mod h1:XukKJg4Y7QsUu0Hxg3qQKUWR4VuWivmyMK2+rUyxAqw= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0 h1:STgFzyU5/8miMl0//zKh2aQeTyeaUH3WN9bSUiJ09bA= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= +github.com/agext/levenshtein v1.2.2 h1:0S/Yg6LYmFJ5stwQeRp6EeOcCbj7xiqQSdNelsXvaqE= +github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= +github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412 h1:w1UutsfOrms1J05zt7ISrnJIXKzwaspym5BTKGx93EI= +github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412/go.mod h1:WPjqKcmVOxf0XSf3YxCJs6N6AOSrOx3obionmG7T0y0= +github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs= +github.com/andybalholm/crlf v0.0.0-20171020200849-670099aa064f/go.mod h1:k8feO4+kXDxro6ErPXBRTJ/ro2mf0SsFG8s7doP9kJE= +github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= +github.com/apparentlymart/go-cidr v1.0.1 h1:NmIwLZ/KdsjIUlhf+/Np40atNXm/+lZ5txfTJ/SpF+U= +github.com/apparentlymart/go-cidr v1.0.1/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/YjEn/vI25Lg7Gwc= +github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= +github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0 h1:MzVXffFUye+ZcSR6opIgz9Co7WcDx6ZcY+RjfFHoA0I= +github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= +github.com/apparentlymart/go-textseg v1.0.0 h1:rRmlIsPEEhUTIKQb7T++Nz/A5Q6C9IuX2wFoYVvnCs0= +github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= +github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= +github.com/beevik/etree v1.1.0 h1:T0xke/WvNtMoCqgzPhkX2r4rjY3GDZFi+FjpRZY2Jbs= +github.com/beevik/etree v1.1.0/go.mod h1:r8Aw8JqVegEf0w2fDnATrX9VpkMcyFeM0FhwO62wh+A= +github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= +github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc h1:biVzkmvwrH8WK8raXaxBx6fRVTlJILwEwQGL1I/ByEI= +github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg= +github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/evanphx/json-patch v0.5.2 h1:xVCHIVMUu1wtM/VkR9jVZ45N3FhZfYMMYGorLCR8P3k= +github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s= +github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= +github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= +github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= +github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4= +github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= +github.com/go-git/go-billy/v5 v5.0.0 h1:7NQHvd9FVid8VL4qVUMm8XifBK+2xCoZ2lSk0agRrHM= +github.com/go-git/go-billy/v5 v5.0.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= +github.com/go-git/go-git-fixtures/v4 v4.0.1/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw= +github.com/go-git/go-git/v5 v5.1.0 h1:HxJn9g/E7eYvKW3Fm7Jt4ee8LXfPOm/H1cdDu8vEssk= +github.com/go-git/go-git/v5 v5.1.0/go.mod h1:ZKfuPUoY1ZqIG4QG9BDBh3G4gLM5zvPuSJAozQrZuyM= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= +github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0 h1:pMen7vLs8nvgEYhywH3KDWJIJTeEr2ULsVWHWYHQyBs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.1.0 h1:L9otHY+jGNNTr2zhDwiYSSWGCyCcNckvETR/KcWxYV8= +github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.1.0/go.mod h1:C6GVuO9RWOrt6QCGTmLCOYuSHpkfQSBDuRqTteOlo0g= +github.com/hashicorp/aws-sdk-go-base v0.7.1 h1:7s/aR3hFn74tYPVihzDyZe7y/+BorN70rr9ZvpV3j3o= +github.com/hashicorp/aws-sdk-go-base v0.7.1/go.mod h1:2fRjWDv3jJBeN6mVWFHV6hFTNeFBx2gpDLQaZNxUVAY= +github.com/hashicorp/aws-sdk-go-private v1.39.2-0.20210716172600-daec78152c52 h1:sZDCA2/1P2cLwZq55G5JF9Qz1C/YopoGkkxvkEvPIyQ= +github.com/hashicorp/aws-sdk-go-private v1.39.2-0.20210716172600-daec78152c52/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= +github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-checkpoint v0.5.0 h1:MFYpPZCnQqQTE18jFwSII6eUQrD/oxMFp3mlgcqk5mU= +github.com/hashicorp/go-checkpoint v0.5.0/go.mod h1:7nfLNL10NsxqO4iWuW6tWW0HjZuDrwkBuEQsVcpCOgg= +github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= +github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= +github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 h1:1/D3zfFHttUKaCaGKZ/dR2roBXv0vKbSCnssIldfQdI= +github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320/go.mod h1:EiZBMaudVLy8fmjf9Npq1dq9RalhveqZG5w/yz3mHWs= +github.com/hashicorp/go-getter v1.4.0/go.mod h1:7qxyCd8rBfcShwsvxgIguu4KbS3l8bUCwg2Umn7RjeY= +github.com/hashicorp/go-getter v1.5.0 h1:ciWJaeZWSMbc5OiLMpKp40MKFPqO44i0h3uyfXPBkkk= +github.com/hashicorp/go-getter v1.5.0/go.mod h1:a7z7NPPfNQpJWcn4rSWFtdrSldqLdLPEF3d8nFMsSLM= +github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= +github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-hclog v0.15.0 h1:qMuK0wxsoW4D0ddCCYwPSTm4KQv1X1ke3WmPWZ0Mvsk= +github.com/hashicorp/go-hclog v0.15.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= +github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= +github.com/hashicorp/go-plugin v1.3.0/go.mod h1:F9eH4LrE/ZsRdbwhfjs9k9HoDUwAHnYtXdgmf1AVNs0= +github.com/hashicorp/go-plugin v1.4.0 h1:b0O7rs5uiJ99Iu9HugEzsM67afboErkHUWddUSpUO3A= +github.com/hashicorp/go-plugin v1.4.0/go.mod h1:5fGEH17QVwTTcR0zV7yhDPLLmFX9YSZ38b18Udy6vYQ= +github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= +github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.3.0 h1:McDWVJIU/y+u1BRV06dPaLfLCaT7fUTJLp5r04x7iNw= +github.com/hashicorp/go-version v1.3.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/hcl/v2 v2.3.0 h1:iRly8YaMwTBAKhn1Ybk7VSdzbnopghktCD031P8ggUE= +github.com/hashicorp/hcl/v2 v2.3.0/go.mod h1:d+FwDBbOLvpAM3Z6J7gPj/VoAGkNe/gm352ZhjJ/Zv8= +github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= +github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/terraform-exec v0.13.0 h1:1Pth+pdWJAufJuWWjaVOVNEkoRTOjGn3hQpAqj4aPdg= +github.com/hashicorp/terraform-exec v0.13.0/go.mod h1:SGhto91bVRlgXQWcJ5znSz+29UZIa8kpBbkGwQ+g9E8= +github.com/hashicorp/terraform-json v0.8.0 h1:XObQ3PgqU52YLQKEaJ08QtUshAfN3yu4u8ebSW0vztc= +github.com/hashicorp/terraform-json v0.8.0/go.mod h1:3defM4kkMfttwiE7VakJDwCd4R+umhSQnvJwORXbprE= +github.com/hashicorp/terraform-plugin-go v0.2.1 h1:EW/R8bB2Zbkjmugzsy1d27yS8/0454b3MtYHkzOknqA= +github.com/hashicorp/terraform-plugin-go v0.2.1/go.mod h1:10V6F3taeDWVAoLlkmArKttR3IULlRWFAGtQIQTIDr4= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.5.0 h1:4EHNOAjwiYCeBxY16rt2KwyRNNVsCaVO3kWBbiXfYM0= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.5.0/go.mod h1:z+cMZ0iswzZOahBJ3XmNWgWkVnAd2bl8g+FhyyuPDH4= +github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= +github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d h1:kJCB4vdITiW1eC1vq2e6IsrXKrZit1bv/TDYFGMp4BQ= +github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/imdario/mergo v0.3.9 h1:UauaLniWCFHWd+Jp9oCEkTBj8VO/9DKg3PV3VCNMDIg= +github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= +github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= +github.com/jen20/awspolicyequivalence v1.1.0 h1:cn37D6o0lXLwqx2neCokGfaB3LLNSo5CrLMLGjY609g= +github.com/jen20/awspolicyequivalence v1.1.0/go.mod h1:PV1fS2xyHhCLp83vbgSMFr2drM4GzG61wkz+k4pOG3E= +github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE= +github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74= +github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1 h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd h1:Coekwdh0v2wtGp9Gmz1Ze3eVRAWJMLokvN3QjdzCHLY= +github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= +github.com/keybase/go-crypto v0.0.0-20161004153544-93f5b35093ba h1:NARVGAAgEXvoMeNPHhPFt1SBt1VMznA3Gnz9d0qj+co= +github.com/keybase/go-crypto v0.0.0-20161004153544-93f5b35093ba/go.mod h1:ghbZscTyKdM07+Fw3KSi0hcJm+AlEUWj8QLlPtijN/M= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/mattbaird/jsonpatch v0.0.0-20200820163806-098863c1fc24 h1:uYuGXJBAi1umT+ZS4oQJUgKtfXCAYTR+n9zw1ViT0vA= +github.com/mattbaird/jsonpatch v0.0.0-20200820163806-098863c1fc24/go.mod h1:M1qoD/MqPgTZIk0EWKB38wE28ACRfVcn+cU08jyArI0= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.7 h1:bQGKb3vps/j0E9GfJQ03JyhRuxsvdAanXlT9BTw3mdw= +github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= +github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= +github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mitchellh/cli v1.1.1/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= +github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= +github.com/mitchellh/copystructure v1.1.1 h1:Bp6x9R1Wn16SIz3OfeDr0b7RnCG2OB66Y7PQyC/cvq4= +github.com/mitchellh/copystructure v1.1.1/go.mod h1:EBArHfARyrSWO/+Wyr9zwEkc6XMFB9XyNgFNmRkZZU4= +github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/go-testing-interface v1.0.4/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= +github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= +github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= +github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4= +github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= +github.com/mitchellh/mapstructure v1.0.0/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/mitchellh/reflectwalk v1.0.1 h1:FVzMWA5RllMAKIdUSC8mdWo3XtwoecrH79BY70sEEpE= +github.com/mitchellh/reflectwalk v1.0.1/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/nsf/jsondiff v0.0.0-20200515183724-f29ed568f4ce h1:RPclfga2SEJmgMmz2k+Mg7cowZ8yv4Trqw9UsJby758= +github.com/nsf/jsondiff v0.0.0-20200515183724-f29ed568f4ce/go.mod h1:uFMI8w+ref4v2r9jz+c9i1IfIttS/OkmLfrk1jne5hs= +github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= +github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= +github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/pquerna/otp v1.3.0 h1:oJV/SkzR33anKXwQU3Of42rL4wbrffP4uvUf1SvS5Xs= +github.com/pquerna/otp v1.3.0/go.mod h1:dkJfzwRKNiegxyNb54X/3fLwhCynbMspSyWKnvi1AEg= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= +github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/ulikunitz/xz v0.5.5/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= +github.com/ulikunitz/xz v0.5.8 h1:ERv8V6GKqVi23rgu5cj9pVfVzJbOqAY2Ntl88O6c2nQ= +github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= +github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= +github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI= +github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= +github.com/xanzy/ssh-agent v0.2.1 h1:TCbipTQL2JiiCprBWx9frJ2eJlCYT00NmctrHxVAr70= +github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4= +github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c= +github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= +github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0= +github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= +github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= +github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= +github.com/zclconf/go-cty v1.2.1 h1:vGMsygfmeCl4Xb6OA5U5XVAaQZ69FvoG7X2jUtQujb8= +github.com/zclconf/go-cty v1.2.1/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= +github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4 h1:LYy1Hy3MJdrCdMwwzxA/dRok4ejH+RwNGbuoD9fCjto= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20180530234432-1e491301e022/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20210614182718-04defd469f4e h1:XpT3nA5TvE525Ne3hInMh6+GETgn27Zfm9dxsThnX2Q= +golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190221075227-b4e8571b14e0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da h1:b3NXsE2LusjYGGjL5bxEVZZORm/YEFFrWFjR8eFrw/c= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200713011307-fd294ab11aed h1:+qzWo37K31KxduIYaBeMqJ8MUOyTayOQKpH9aDPLMSY= +golang.org/x/tools v0.0.0-20200713011307-fd294ab11aed/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0 h1:BaiDisFir8O4IJxvAabCGGkQ6yCJegNQqSVoYUNAnbk= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20170818010345-ee236bd376b0/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200711021454-869866162049 h1:YFTFpQhgvrLrmxtiIncJxFXeCyq84ixuKWVCaCAi9Oc= +google.golang.org/genproto v0.0.0-20200711021454-869866162049/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.32.0 h1:zWTV+LMdc3kaiJMSTOFz2UgSBgx8RNQoTGiZu3fR9S0= +google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= +gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= From ea430801d6ef6b9f968bfcb10cf6b12f39e75280 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 20 Jul 2021 16:59:29 -0400 Subject: [PATCH 08/33] Simplified JSON Patch document generation. --- .../cloudformation/cfjsonpatch/cfjsonpatch.go | 102 ------------------ aws/resource_aws_cloudformation_resource.go | 38 ++++--- 2 files changed, 26 insertions(+), 114 deletions(-) delete mode 100644 aws/internal/service/cloudformation/cfjsonpatch/cfjsonpatch.go diff --git a/aws/internal/service/cloudformation/cfjsonpatch/cfjsonpatch.go b/aws/internal/service/cloudformation/cfjsonpatch/cfjsonpatch.go deleted file mode 100644 index 34b96a5962a..00000000000 --- a/aws/internal/service/cloudformation/cfjsonpatch/cfjsonpatch.go +++ /dev/null @@ -1,102 +0,0 @@ -// cfjsonpatch implements CloudFormation customizations for RFC 6902 JSON Patch operations. -// -// This functionality is temporary, as the API will be updated to support standard -// RFC 6902 JSON Patch Value field. -package cfjsonpatch - -import ( - "encoding/json" - "fmt" - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/cloudformation" - "github.com/mattbaird/jsonpatch" -) - -const ( - EmptyDocument = "{}" -) - -func PatchOperations(oldRaw interface{}, newRaw interface{}) ([]*cloudformation.PatchOperation, error) { - old, ok := oldRaw.(string) - - if !ok { - old = EmptyDocument - } - - new, ok := newRaw.(string) - - if !ok { - new = EmptyDocument - } - - rfc6902patch, err := createRFC6902Patch([]byte(old), []byte(new)) - - if err != nil { - return nil, err - } - - return convertRFC6902Patch(rfc6902patch) -} - -func createRFC6902Patch(a []byte, b []byte) ([]jsonpatch.JsonPatchOperation, error) { - patch, err := jsonpatch.CreatePatch(a, b) - - if err != nil { - return nil, err - } - - log.Printf("[DEBUG] RFC 6902 JSON Patch: %s", patch) - - return patch, nil -} - -func convertRFC6902Patch(patches []jsonpatch.JsonPatchOperation) ([]*cloudformation.PatchOperation, error) { - patchOperations := make([]*cloudformation.PatchOperation, len(patches)) - - for idx, patch := range patches { - patchOperation := &cloudformation.PatchOperation{ - Op: aws.String(patch.Operation), - Path: aws.String(patch.Path), - } - - if patch.Value == nil { - patchOperations[idx] = patchOperation - continue - } - - switch value := patch.Value.(type) { - default: - log.Printf("[DEBUG] Object JSON Patch value type: %T", value) - - v, err := json.Marshal(value) - - if err != nil { - return nil, fmt.Errorf("unable to marshal JSON Patch value: %w", err) - } - - patchOperation.ObjectValue = aws.String(string(v)) - case bool: - patchOperation.BooleanValue = aws.Bool(value) - case float64: - // jsonpatch does not differentiate between integer versus number types - // and proper typing would require the CloudFormation resource schema. - // To keep things simple for now since most properties are integer, - // fuzzy match round numbers to integer values. - if value == float64(int64(value)) { - patchOperation.IntegerValue = aws.Int64(int64(value)) - } else { - patchOperation.NumberValue = aws.Float64(value) - } - case string: - patchOperation.StringValue = aws.String(value) - } - - patchOperations[idx] = patchOperation - } - - log.Printf("[DEBUG] CloudFormation JSON Patch: %s", patchOperations) - - return patchOperations, nil -} diff --git a/aws/resource_aws_cloudformation_resource.go b/aws/resource_aws_cloudformation_resource.go index 6d588b6a510..a03af21b42c 100644 --- a/aws/resource_aws_cloudformation_resource.go +++ b/aws/resource_aws_cloudformation_resource.go @@ -2,6 +2,7 @@ package aws import ( "context" + "encoding/json" "fmt" "log" "regexp" @@ -16,7 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/cloudformation/cfjsonpatch" + "github.com/mattbaird/jsonpatch" "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/cloudformation/waiter" ) @@ -174,7 +175,7 @@ func resourceAwsCloudFormationResourceUpdate(ctx context.Context, d *schema.Reso if d.HasChange("desired_state") { oldRaw, newRaw := d.GetChange("desired_state") - patchOperations, err := cfjsonpatch.PatchOperations(oldRaw, newRaw) + patchDocument, err := patchDocument(oldRaw.(string), newRaw.(string)) if err != nil { return diag.Diagnostics{ @@ -187,9 +188,9 @@ func resourceAwsCloudFormationResourceUpdate(ctx context.Context, d *schema.Reso } input := &cloudformation.UpdateResourceInput{ - ClientToken: aws.String(resource.UniqueId()), - Identifier: aws.String(d.Id()), - PatchOperations: patchOperations, + ClientToken: aws.String(resource.UniqueId()), + Identifier: aws.String(d.Id()), + PatchDocument: aws.String(patchDocument), } if v, ok := d.GetOk("role_arn"); ok { @@ -333,18 +334,14 @@ func resourceAwsCloudFormationResourceCustomizeDiffSchemaDiff(ctx context.Contex return fmt.Errorf("error converting CloudFormation Resource Schema JSON: %w", err) } - patchOperations, err := cfjsonpatch.PatchOperations(oldDesiredStateRaw, newDesiredStateRaw) + patches, err := jsonpatch.CreatePatch([]byte(oldDesiredStateRaw.(string)), []byte(newDesiredStateRaw.(string))) if err != nil { return fmt.Errorf("error creating desired_state JSON Patch: %w", err) } - for _, patchOperation := range patchOperations { - if patchOperation == nil { - continue - } - - if cfResource.IsCreateOnlyPropertyPath(aws.StringValue(patchOperation.Path)) { + for _, patch := range patches { + if cfResource.IsCreateOnlyPropertyPath(patch.Path) { if err := diff.ForceNew("desired_state"); err != nil { return fmt.Errorf("error setting desired_state ForceNew: %w", err) } @@ -355,3 +352,20 @@ func resourceAwsCloudFormationResourceCustomizeDiffSchemaDiff(ctx context.Contex return nil } + +// patchDocument returns a JSON Patch document describing the difference between `old` and `new`. +func patchDocument(old, new string) (string, error) { + patch, err := jsonpatch.CreatePatch([]byte(old), []byte(new)) + + if err != nil { + return "", err + } + + b, err := json.Marshal(patch) + + if err != nil { + return "", err + } + + return string(b), nil +} From c1bb87bd5e22f88d5cc786954e9fb5f33d121ad2 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 20 Jul 2021 17:23:00 -0400 Subject: [PATCH 09/33] CloudFormation now reverting boolean value to property default. --- aws/resource_aws_cloudformation_resource_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/aws/resource_aws_cloudformation_resource_test.go b/aws/resource_aws_cloudformation_resource_test.go index 85c2306d5ee..93b7fce79a4 100644 --- a/aws/resource_aws_cloudformation_resource_test.go +++ b/aws/resource_aws_cloudformation_resource_test.go @@ -100,8 +100,7 @@ func TestAccAwsCloudformationResource_DesiredState_BooleanValueRemoved(t *testin { Config: testAccAwsCloudformationResourceConfigDesiredStateBooleanValueRemoved(rName), Check: resource.ComposeAggregateTestCheckFunc( - // JSON patch operation is submitted, but CloudFormation does not revert value to property default - resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"Enabled":true`)), + resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"Enabled":false`)), ), }, }, From ec4636b21c30d0289d15de5cc20162e8325551f0 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 15 Sep 2021 16:44:12 -0400 Subject: [PATCH 10/33] Run 'go mod download github.com/hashicorp/terraform-plugin-sdk/v2 && go mod tidy'. --- go.sum | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/go.sum b/go.sum index 9c6484c5b26..f18fb5138dc 100644 --- a/go.sum +++ b/go.sum @@ -34,6 +34,13 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9 dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= +github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= +github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= +github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= +github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= +github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7/go.mod h1:z4/9nQmJSSwwds7ejkxaJwO37dru3geImFUdJlaLzQo= +github.com/acomagu/bufpipe v1.0.3/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4= github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/agext/levenshtein v1.2.2 h1:0S/Yg6LYmFJ5stwQeRp6EeOcCbj7xiqQSdNelsXvaqE= github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= @@ -50,6 +57,7 @@ github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0/go.mod h1:o github.com/apparentlymart/go-textseg v1.0.0 h1:rRmlIsPEEhUTIKQb7T++Nz/A5Q6C9IuX2wFoYVvnCs0= github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= +github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/beevik/etree v1.1.0 h1:T0xke/WvNtMoCqgzPhkX2r4rjY3GDZFi+FjpRZY2Jbs= @@ -82,14 +90,20 @@ github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5Kwzbycv github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= +github.com/gdavison/terraform-plugin-sdk/v2 v2.7.1-0.20210913224932-c7c2dbd9e010 h1:05JaIuXKUa+nXrb/LUDvlGQ7qvAdxCCGiIf/XIv7sYA= +github.com/gdavison/terraform-plugin-sdk/v2 v2.7.1-0.20210913224932-c7c2dbd9e010/go.mod h1:O4vVRy2W0P3810kdyNmG4wKcm4wLX/arLxuxjPA1IpA= github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4= github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= github.com/go-git/go-billy/v5 v5.0.0 h1:7NQHvd9FVid8VL4qVUMm8XifBK+2xCoZ2lSk0agRrHM= github.com/go-git/go-billy/v5 v5.0.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= +github.com/go-git/go-billy/v5 v5.2.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= +github.com/go-git/go-billy/v5 v5.3.1/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= github.com/go-git/go-git-fixtures/v4 v4.0.1/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw= +github.com/go-git/go-git-fixtures/v4 v4.2.1/go.mod h1:K8zd3kDUAykwTdDCr+I0per6Y6vMiRR/nnVTBtavnB0= github.com/go-git/go-git/v5 v5.1.0 h1:HxJn9g/E7eYvKW3Fm7Jt4ee8LXfPOm/H1cdDu8vEssk= github.com/go-git/go-git/v5 v5.1.0/go.mod h1:ZKfuPUoY1ZqIG4QG9BDBh3G4gLM5zvPuSJAozQrZuyM= +github.com/go-git/go-git/v5 v5.4.2/go.mod h1:gQ1kArt6d+n+BGd+/B/I74HwRTLhth2+zti4ihgckDc= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -132,6 +146,7 @@ github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0 h1:pMen7vLs8nvgEYhywH3KDWJIJTeEr2ULsVWHWYHQyBs= @@ -144,6 +159,7 @@ github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= @@ -166,6 +182,7 @@ github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320/go.mod h1:EiZBM github.com/hashicorp/go-getter v1.4.0/go.mod h1:7qxyCd8rBfcShwsvxgIguu4KbS3l8bUCwg2Umn7RjeY= github.com/hashicorp/go-getter v1.5.0 h1:ciWJaeZWSMbc5OiLMpKp40MKFPqO44i0h3uyfXPBkkk= github.com/hashicorp/go-getter v1.5.0/go.mod h1:a7z7NPPfNQpJWcn4rSWFtdrSldqLdLPEF3d8nFMsSLM= +github.com/hashicorp/go-getter v1.5.3/go.mod h1:BrrV/1clo8cCYu6mxvboYg+KutTiFnXjMEgDD8+i7ZI= github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-hclog v0.15.0 h1:qMuK0wxsoW4D0ddCCYwPSTm4KQv1X1ke3WmPWZ0Mvsk= @@ -176,6 +193,7 @@ github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9 github.com/hashicorp/go-plugin v1.3.0/go.mod h1:F9eH4LrE/ZsRdbwhfjs9k9HoDUwAHnYtXdgmf1AVNs0= github.com/hashicorp/go-plugin v1.4.0 h1:b0O7rs5uiJ99Iu9HugEzsM67afboErkHUWddUSpUO3A= github.com/hashicorp/go-plugin v1.4.0/go.mod h1:5fGEH17QVwTTcR0zV7yhDPLLmFX9YSZ38b18Udy6vYQ= +github.com/hashicorp/go-plugin v1.4.1/go.mod h1:5fGEH17QVwTTcR0zV7yhDPLLmFX9YSZ38b18Udy6vYQ= github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= @@ -193,23 +211,30 @@ github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/terraform-exec v0.13.0 h1:1Pth+pdWJAufJuWWjaVOVNEkoRTOjGn3hQpAqj4aPdg= github.com/hashicorp/terraform-exec v0.13.0/go.mod h1:SGhto91bVRlgXQWcJ5znSz+29UZIa8kpBbkGwQ+g9E8= +github.com/hashicorp/terraform-exec v0.14.0/go.mod h1:qrAASDq28KZiMPDnQ02sFS9udcqEkRly002EA2izXTA= github.com/hashicorp/terraform-json v0.8.0 h1:XObQ3PgqU52YLQKEaJ08QtUshAfN3yu4u8ebSW0vztc= github.com/hashicorp/terraform-json v0.8.0/go.mod h1:3defM4kkMfttwiE7VakJDwCd4R+umhSQnvJwORXbprE= +github.com/hashicorp/terraform-json v0.12.0/go.mod h1:pmbq9o4EuL43db5+0ogX10Yofv1nozM+wskr/bGFJpI= github.com/hashicorp/terraform-plugin-go v0.2.1 h1:EW/R8bB2Zbkjmugzsy1d27yS8/0454b3MtYHkzOknqA= github.com/hashicorp/terraform-plugin-go v0.2.1/go.mod h1:10V6F3taeDWVAoLlkmArKttR3IULlRWFAGtQIQTIDr4= +github.com/hashicorp/terraform-plugin-go v0.3.0/go.mod h1:dFHsQMaTLpON2gWhVWT96fvtlc/MF1vSy3OdMhWBzdM= github.com/hashicorp/terraform-plugin-sdk/v2 v2.5.0 h1:4EHNOAjwiYCeBxY16rt2KwyRNNVsCaVO3kWBbiXfYM0= github.com/hashicorp/terraform-plugin-sdk/v2 v2.5.0/go.mod h1:z+cMZ0iswzZOahBJ3XmNWgWkVnAd2bl8g+FhyyuPDH4= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d h1:kJCB4vdITiW1eC1vq2e6IsrXKrZit1bv/TDYFGMp4BQ= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= +github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.9 h1:UauaLniWCFHWd+Jp9oCEkTBj8VO/9DKg3PV3VCNMDIg= github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jen20/awspolicyequivalence v1.1.0 h1:cn37D6o0lXLwqx2neCokGfaB3LLNSo5CrLMLGjY609g= github.com/jen20/awspolicyequivalence v1.1.0/go.mod h1:PV1fS2xyHhCLp83vbgSMFr2drM4GzG61wkz+k4pOG3E= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE= github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= @@ -221,11 +246,15 @@ github.com/jstemmer/go-junit-report v0.9.1 h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfE github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd h1:Coekwdh0v2wtGp9Gmz1Ze3eVRAWJMLokvN3QjdzCHLY= github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= +github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/keybase/go-crypto v0.0.0-20161004153544-93f5b35093ba h1:NARVGAAgEXvoMeNPHhPFt1SBt1VMznA3Gnz9d0qj+co= github.com/keybase/go-crypto v0.0.0-20161004153544-93f5b35093ba/go.mod h1:ghbZscTyKdM07+Fw3KSi0hcJm+AlEUWj8QLlPtijN/M= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.11.2/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -233,6 +262,7 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= github.com/mattbaird/jsonpatch v0.0.0-20200820163806-098863c1fc24 h1:uYuGXJBAi1umT+ZS4oQJUgKtfXCAYTR+n9zw1ViT0vA= github.com/mattbaird/jsonpatch v0.0.0-20200820163806-098863c1fc24/go.mod h1:M1qoD/MqPgTZIk0EWKB38wE28ACRfVcn+cU08jyArI0= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= @@ -248,9 +278,11 @@ github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHX github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mitchellh/cli v1.1.1/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= +github.com/mitchellh/cli v1.1.2/go.mod h1:6iaV0fGdElS6dPBx0EApTxHrcWvmJphyh2n8YBLPPZ4= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/copystructure v1.1.1 h1:Bp6x9R1Wn16SIz3OfeDr0b7RnCG2OB66Y7PQyC/cvq4= github.com/mitchellh/copystructure v1.1.1/go.mod h1:EBArHfARyrSWO/+Wyr9zwEkc6XMFB9XyNgFNmRkZZU4= +github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= @@ -268,6 +300,7 @@ github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.1 h1:FVzMWA5RllMAKIdUSC8mdWo3XtwoecrH79BY70sEEpE= github.com/mitchellh/reflectwalk v1.0.1/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nsf/jsondiff v0.0.0-20200515183724-f29ed568f4ce h1:RPclfga2SEJmgMmz2k+Mg7cowZ8yv4Trqw9UsJby758= @@ -285,24 +318,33 @@ github.com/pquerna/otp v1.3.0 h1:oJV/SkzR33anKXwQU3Of42rL4wbrffP4uvUf1SvS5Xs= github.com/pquerna/otp v1.3.0/go.mod h1:dkJfzwRKNiegxyNb54X/3fLwhCynbMspSyWKnvi1AEg= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/sebdah/goldie v1.0.0/go.mod h1:jXP4hmWywNEwZzhMuv2ccnqTSFpuq8iyQhtQdkkZBH4= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/ulikunitz/xz v0.5.5/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= github.com/ulikunitz/xz v0.5.8 h1:ERv8V6GKqVi23rgu5cj9pVfVzJbOqAY2Ntl88O6c2nQ= github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI= github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= +github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4= +github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= github.com/xanzy/ssh-agent v0.2.1 h1:TCbipTQL2JiiCprBWx9frJ2eJlCYT00NmctrHxVAr70= github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4= +github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0= @@ -315,6 +357,7 @@ github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= github.com/zclconf/go-cty v1.2.1 h1:vGMsygfmeCl4Xb6OA5U5XVAaQZ69FvoG7X2jUtQujb8= github.com/zclconf/go-cty v1.2.1/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= +github.com/zclconf/go-cty v1.8.4/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= @@ -331,6 +374,9 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -390,6 +436,8 @@ golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k= golang.org/x/net v0.0.0-20210614182718-04defd469f4e h1:XpT3nA5TvE525Ne3hInMh6+GETgn27Zfm9dxsThnX2Q= golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -408,6 +456,7 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190221075227-b4e8571b14e0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -419,6 +468,7 @@ golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -438,14 +488,18 @@ golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da h1:b3NXsE2LusjYGGjL5bxEVZZORm/YEFFrWFjR8eFrw/c= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210502180810-71e4cd670f79/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -576,6 +630,7 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= @@ -583,6 +638,7 @@ gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRN gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= From 99a5a02d645f56a57c003b5632f370312bca57df Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 15 Sep 2021 16:49:44 -0400 Subject: [PATCH 11/33] Run 'go mod edit -replace=github.com/aws/aws-sdk-go=github.com/hashicorp/aws-sdk-go-private@499245543dfdf07814cdbcef7e9cabcad81b4a13'. --- go.mod | 2 +- go.sum | 78 ++++++++++++++++++++++------------------------------------ 2 files changed, 30 insertions(+), 50 deletions(-) diff --git a/go.mod b/go.mod index 6908d0cfc22..b48deef0845 100644 --- a/go.mod +++ b/go.mod @@ -28,6 +28,6 @@ require ( gopkg.in/yaml.v2 v2.4.0 ) -replace github.com/aws/aws-sdk-go => github.com/hashicorp/aws-sdk-go-private v1.39.2-0.20210716172600-daec78152c52 +replace github.com/aws/aws-sdk-go => github.com/hashicorp/aws-sdk-go-private v1.40.42-0.20210915192203-499245543dfd replace github.com/hashicorp/terraform-plugin-sdk/v2 => github.com/gdavison/terraform-plugin-sdk/v2 v2.7.1-0.20210913224932-c7c2dbd9e010 diff --git a/go.sum b/go.sum index f18fb5138dc..89a12d7c6c7 100644 --- a/go.sum +++ b/go.sum @@ -38,15 +38,17 @@ github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy86 github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= +github.com/Microsoft/go-winio v0.4.16 h1:FtSW/jqD+l4ba5iPBj9CODVtgfYAD8w2wS923g/cFDk= github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= +github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 h1:YoJbenK9C67SkzkDfmQuVln04ygHj3vjZfd9FL+GmQQ= github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7/go.mod h1:z4/9nQmJSSwwds7ejkxaJwO37dru3geImFUdJlaLzQo= +github.com/acomagu/bufpipe v1.0.3 h1:fxAGrHZTgQ9w5QqVItgzwj235/uYZYgbXitB+dLupOk= github.com/acomagu/bufpipe v1.0.3/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4= github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/agext/levenshtein v1.2.2 h1:0S/Yg6LYmFJ5stwQeRp6EeOcCbj7xiqQSdNelsXvaqE= github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412 h1:w1UutsfOrms1J05zt7ISrnJIXKzwaspym5BTKGx93EI= github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412/go.mod h1:WPjqKcmVOxf0XSf3YxCJs6N6AOSrOx3obionmG7T0y0= -github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs= github.com/andybalholm/crlf v0.0.0-20171020200849-670099aa064f/go.mod h1:k8feO4+kXDxro6ErPXBRTJ/ro2mf0SsFG8s7doP9kJE= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/apparentlymart/go-cidr v1.0.1 h1:NmIwLZ/KdsjIUlhf+/Np40atNXm/+lZ5txfTJ/SpF+U= @@ -57,6 +59,7 @@ github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0/go.mod h1:o github.com/apparentlymart/go-textseg v1.0.0 h1:rRmlIsPEEhUTIKQb7T++Nz/A5Q6C9IuX2wFoYVvnCs0= github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= +github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw= github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= @@ -95,14 +98,11 @@ github.com/gdavison/terraform-plugin-sdk/v2 v2.7.1-0.20210913224932-c7c2dbd9e010 github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4= github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= -github.com/go-git/go-billy/v5 v5.0.0 h1:7NQHvd9FVid8VL4qVUMm8XifBK+2xCoZ2lSk0agRrHM= -github.com/go-git/go-billy/v5 v5.0.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= github.com/go-git/go-billy/v5 v5.2.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= +github.com/go-git/go-billy/v5 v5.3.1 h1:CPiOUAzKtMRvolEKw+bG1PLRpT7D3LIs3/3ey4Aiu34= github.com/go-git/go-billy/v5 v5.3.1/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= -github.com/go-git/go-git-fixtures/v4 v4.0.1/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw= github.com/go-git/go-git-fixtures/v4 v4.2.1/go.mod h1:K8zd3kDUAykwTdDCr+I0per6Y6vMiRR/nnVTBtavnB0= -github.com/go-git/go-git/v5 v5.1.0 h1:HxJn9g/E7eYvKW3Fm7Jt4ee8LXfPOm/H1cdDu8vEssk= -github.com/go-git/go-git/v5 v5.1.0/go.mod h1:ZKfuPUoY1ZqIG4QG9BDBh3G4gLM5zvPuSJAozQrZuyM= +github.com/go-git/go-git/v5 v5.4.2 h1:BXyZu9t0VkbiHtqrsvdq39UDhGJTl1h55VW6CSC4aY4= github.com/go-git/go-git/v5 v5.4.2/go.mod h1:gQ1kArt6d+n+BGd+/B/I74HwRTLhth2+zti4ihgckDc= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -135,7 +135,6 @@ github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvq github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -144,8 +143,8 @@ github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= @@ -167,21 +166,18 @@ github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.1.0 h1:L9otHY+ github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.1.0/go.mod h1:C6GVuO9RWOrt6QCGTmLCOYuSHpkfQSBDuRqTteOlo0g= github.com/hashicorp/aws-sdk-go-base v0.7.1 h1:7s/aR3hFn74tYPVihzDyZe7y/+BorN70rr9ZvpV3j3o= github.com/hashicorp/aws-sdk-go-base v0.7.1/go.mod h1:2fRjWDv3jJBeN6mVWFHV6hFTNeFBx2gpDLQaZNxUVAY= -github.com/hashicorp/aws-sdk-go-private v1.39.2-0.20210716172600-daec78152c52 h1:sZDCA2/1P2cLwZq55G5JF9Qz1C/YopoGkkxvkEvPIyQ= -github.com/hashicorp/aws-sdk-go-private v1.39.2-0.20210716172600-daec78152c52/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= +github.com/hashicorp/aws-sdk-go-private v1.40.42-0.20210915192203-499245543dfd h1:F8kyugZaV1xu7PWOqezDdeVNZxL2pG9KhGTOxnXyjzE= +github.com/hashicorp/aws-sdk-go-private v1.40.42-0.20210915192203-499245543dfd/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-checkpoint v0.5.0 h1:MFYpPZCnQqQTE18jFwSII6eUQrD/oxMFp3mlgcqk5mU= github.com/hashicorp/go-checkpoint v0.5.0/go.mod h1:7nfLNL10NsxqO4iWuW6tWW0HjZuDrwkBuEQsVcpCOgg= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 h1:1/D3zfFHttUKaCaGKZ/dR2roBXv0vKbSCnssIldfQdI= github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320/go.mod h1:EiZBMaudVLy8fmjf9Npq1dq9RalhveqZG5w/yz3mHWs= -github.com/hashicorp/go-getter v1.4.0/go.mod h1:7qxyCd8rBfcShwsvxgIguu4KbS3l8bUCwg2Umn7RjeY= -github.com/hashicorp/go-getter v1.5.0 h1:ciWJaeZWSMbc5OiLMpKp40MKFPqO44i0h3uyfXPBkkk= -github.com/hashicorp/go-getter v1.5.0/go.mod h1:a7z7NPPfNQpJWcn4rSWFtdrSldqLdLPEF3d8nFMsSLM= +github.com/hashicorp/go-getter v1.5.3 h1:NF5+zOlQegim+w/EUhSLh6QhXHmZMEeHLQzllkQ3ROU= github.com/hashicorp/go-getter v1.5.3/go.mod h1:BrrV/1clo8cCYu6mxvboYg+KutTiFnXjMEgDD8+i7ZI= github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= @@ -191,8 +187,7 @@ github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHh github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/go-plugin v1.3.0/go.mod h1:F9eH4LrE/ZsRdbwhfjs9k9HoDUwAHnYtXdgmf1AVNs0= -github.com/hashicorp/go-plugin v1.4.0 h1:b0O7rs5uiJ99Iu9HugEzsM67afboErkHUWddUSpUO3A= -github.com/hashicorp/go-plugin v1.4.0/go.mod h1:5fGEH17QVwTTcR0zV7yhDPLLmFX9YSZ38b18Udy6vYQ= +github.com/hashicorp/go-plugin v1.4.1 h1:6UltRQlLN9iZO513VveELp5xyaFxVD2+1OVylE+2E+w= github.com/hashicorp/go-plugin v1.4.1/go.mod h1:5fGEH17QVwTTcR0zV7yhDPLLmFX9YSZ38b18Udy6vYQ= github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I= @@ -200,7 +195,6 @@ github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/b github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.3.0 h1:McDWVJIU/y+u1BRV06dPaLfLCaT7fUTJLp5r04x7iNw= github.com/hashicorp/go-version v1.3.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= @@ -209,25 +203,19 @@ github.com/hashicorp/hcl/v2 v2.3.0 h1:iRly8YaMwTBAKhn1Ybk7VSdzbnopghktCD031P8ggU github.com/hashicorp/hcl/v2 v2.3.0/go.mod h1:d+FwDBbOLvpAM3Z6J7gPj/VoAGkNe/gm352ZhjJ/Zv8= github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/terraform-exec v0.13.0 h1:1Pth+pdWJAufJuWWjaVOVNEkoRTOjGn3hQpAqj4aPdg= -github.com/hashicorp/terraform-exec v0.13.0/go.mod h1:SGhto91bVRlgXQWcJ5znSz+29UZIa8kpBbkGwQ+g9E8= +github.com/hashicorp/terraform-exec v0.14.0 h1:UQoUcxKTZZXhyyK68Cwn4mApT4mnFPmEXPiqaHL9r+w= github.com/hashicorp/terraform-exec v0.14.0/go.mod h1:qrAASDq28KZiMPDnQ02sFS9udcqEkRly002EA2izXTA= -github.com/hashicorp/terraform-json v0.8.0 h1:XObQ3PgqU52YLQKEaJ08QtUshAfN3yu4u8ebSW0vztc= -github.com/hashicorp/terraform-json v0.8.0/go.mod h1:3defM4kkMfttwiE7VakJDwCd4R+umhSQnvJwORXbprE= +github.com/hashicorp/terraform-json v0.12.0 h1:8czPgEEWWPROStjkWPUnTQDXmpmZPlkQAwYYLETaTvw= github.com/hashicorp/terraform-json v0.12.0/go.mod h1:pmbq9o4EuL43db5+0ogX10Yofv1nozM+wskr/bGFJpI= -github.com/hashicorp/terraform-plugin-go v0.2.1 h1:EW/R8bB2Zbkjmugzsy1d27yS8/0454b3MtYHkzOknqA= -github.com/hashicorp/terraform-plugin-go v0.2.1/go.mod h1:10V6F3taeDWVAoLlkmArKttR3IULlRWFAGtQIQTIDr4= +github.com/hashicorp/terraform-plugin-go v0.3.0 h1:AJqYzP52JFYl9NABRI7smXI1pNjgR5Q/y2WyVJ/BOZA= github.com/hashicorp/terraform-plugin-go v0.3.0/go.mod h1:dFHsQMaTLpON2gWhVWT96fvtlc/MF1vSy3OdMhWBzdM= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.5.0 h1:4EHNOAjwiYCeBxY16rt2KwyRNNVsCaVO3kWBbiXfYM0= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.5.0/go.mod h1:z+cMZ0iswzZOahBJ3XmNWgWkVnAd2bl8g+FhyyuPDH4= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d h1:kJCB4vdITiW1eC1vq2e6IsrXKrZit1bv/TDYFGMp4BQ= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imdario/mergo v0.3.9 h1:UauaLniWCFHWd+Jp9oCEkTBj8VO/9DKg3PV3VCNMDIg= -github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= @@ -244,16 +232,16 @@ github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfC github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1 h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd h1:Coekwdh0v2wtGp9Gmz1Ze3eVRAWJMLokvN3QjdzCHLY= -github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= +github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 h1:DowS9hvgyYSX4TO5NpyC606/Z4SxnNYbT+WX27or6Ck= github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/keybase/go-crypto v0.0.0-20161004153544-93f5b35093ba h1:NARVGAAgEXvoMeNPHhPFt1SBt1VMznA3Gnz9d0qj+co= github.com/keybase/go-crypto v0.0.0-20161004153544-93f5b35093ba/go.mod h1:ghbZscTyKdM07+Fw3KSi0hcJm+AlEUWj8QLlPtijN/M= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.11.2 h1:MiK62aErc3gIiVEtyzKfeOHgW7atJb5g/KNX5m3c2nQ= github.com/klauspost/compress v1.11.2/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= @@ -277,11 +265,9 @@ github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOA github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mitchellh/cli v1.1.1/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= github.com/mitchellh/cli v1.1.2/go.mod h1:6iaV0fGdElS6dPBx0EApTxHrcWvmJphyh2n8YBLPPZ4= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= -github.com/mitchellh/copystructure v1.1.1 h1:Bp6x9R1Wn16SIz3OfeDr0b7RnCG2OB66Y7PQyC/cvq4= -github.com/mitchellh/copystructure v1.1.1/go.mod h1:EBArHfARyrSWO/+Wyr9zwEkc6XMFB9XyNgFNmRkZZU4= +github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= @@ -298,16 +284,13 @@ github.com/mitchellh/mapstructure v1.0.0/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/mitchellh/reflectwalk v1.0.1 h1:FVzMWA5RllMAKIdUSC8mdWo3XtwoecrH79BY70sEEpE= -github.com/mitchellh/reflectwalk v1.0.1/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nsf/jsondiff v0.0.0-20200515183724-f29ed568f4ce h1:RPclfga2SEJmgMmz2k+Mg7cowZ8yv4Trqw9UsJby758= github.com/nsf/jsondiff v0.0.0-20200515183724-f29ed568f4ce/go.mod h1:uFMI8w+ref4v2r9jz+c9i1IfIttS/OkmLfrk1jne5hs= github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= -github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -320,9 +303,10 @@ github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1: github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/sebdah/goldie v1.0.0/go.mod h1:jXP4hmWywNEwZzhMuv2ccnqTSFpuq8iyQhtQdkkZBH4= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= @@ -331,10 +315,9 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/ulikunitz/xz v0.5.5/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= github.com/ulikunitz/xz v0.5.8 h1:ERv8V6GKqVi23rgu5cj9pVfVzJbOqAY2Ntl88O6c2nQ= github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= @@ -342,8 +325,7 @@ github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaU github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4= github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= -github.com/xanzy/ssh-agent v0.2.1 h1:TCbipTQL2JiiCprBWx9frJ2eJlCYT00NmctrHxVAr70= -github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4= +github.com/xanzy/ssh-agent v0.3.0 h1:wUMzuKtKilRgBAD1sUb8gOwwRr2FGoBVumcjoOACClI= github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= @@ -355,8 +337,8 @@ github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= -github.com/zclconf/go-cty v1.2.1 h1:vGMsygfmeCl4Xb6OA5U5XVAaQZ69FvoG7X2jUtQujb8= github.com/zclconf/go-cty v1.2.1/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= +github.com/zclconf/go-cty v1.8.4 h1:pwhhz5P+Fjxse7S7UriBrMu6AUJSZM5pKqGem1PjGAs= github.com/zclconf/go-cty v1.8.4/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= @@ -371,11 +353,10 @@ golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b h1:7mWr3k41Qtv8XlltBkDkl8LoP3mpSgBW8BUoxtEdbXg= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -454,11 +435,9 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190221075227-b4e8571b14e0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -490,9 +469,10 @@ golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da h1:b3NXsE2LusjYGGjL5bxEVZZORm/YEFFrWFjR8eFrw/c= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210502180810-71e4cd670f79 h1:RX8C8PRZc2hTIod4ds8ij+/4RQX3AqhYj3uOHmyaz4E= golang.org/x/sys v0.0.0-20210502180810-71e4cd670f79/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -628,8 +608,8 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= From 785b3171a497dd2b218e95d6cf789b5d5655a8d2 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 15 Sep 2021 16:54:55 -0400 Subject: [PATCH 12/33] Rename files 'cloudformation_resource' -> 'cloudcontrol_resource'. --- ...ation_resource.go => data_source_aws_cloudcontrol_resource.go} | 0 ...urce_test.go => data_source_aws_cloudcontrol_resource_test.go} | 0 ...ormation_resource.go => resource_aws_cloudcontrol_resource.go} | 0 ...esource_test.go => resource_aws_cloudcontrol_resource_test.go} | 0 ...resource.html.markdown => cloudcontrol_resource.html.markdown} | 0 ...resource.html.markdown => cloudcontrol_resource.html.markdown} | 0 6 files changed, 0 insertions(+), 0 deletions(-) rename aws/{data_source_aws_cloudformation_resource.go => data_source_aws_cloudcontrol_resource.go} (100%) rename aws/{data_source_aws_cloudformation_resource_test.go => data_source_aws_cloudcontrol_resource_test.go} (100%) rename aws/{resource_aws_cloudformation_resource.go => resource_aws_cloudcontrol_resource.go} (100%) rename aws/{resource_aws_cloudformation_resource_test.go => resource_aws_cloudcontrol_resource_test.go} (100%) rename website/docs/d/{cloudformation_resource.html.markdown => cloudcontrol_resource.html.markdown} (100%) rename website/docs/r/{cloudformation_resource.html.markdown => cloudcontrol_resource.html.markdown} (100%) diff --git a/aws/data_source_aws_cloudformation_resource.go b/aws/data_source_aws_cloudcontrol_resource.go similarity index 100% rename from aws/data_source_aws_cloudformation_resource.go rename to aws/data_source_aws_cloudcontrol_resource.go diff --git a/aws/data_source_aws_cloudformation_resource_test.go b/aws/data_source_aws_cloudcontrol_resource_test.go similarity index 100% rename from aws/data_source_aws_cloudformation_resource_test.go rename to aws/data_source_aws_cloudcontrol_resource_test.go diff --git a/aws/resource_aws_cloudformation_resource.go b/aws/resource_aws_cloudcontrol_resource.go similarity index 100% rename from aws/resource_aws_cloudformation_resource.go rename to aws/resource_aws_cloudcontrol_resource.go diff --git a/aws/resource_aws_cloudformation_resource_test.go b/aws/resource_aws_cloudcontrol_resource_test.go similarity index 100% rename from aws/resource_aws_cloudformation_resource_test.go rename to aws/resource_aws_cloudcontrol_resource_test.go diff --git a/website/docs/d/cloudformation_resource.html.markdown b/website/docs/d/cloudcontrol_resource.html.markdown similarity index 100% rename from website/docs/d/cloudformation_resource.html.markdown rename to website/docs/d/cloudcontrol_resource.html.markdown diff --git a/website/docs/r/cloudformation_resource.html.markdown b/website/docs/r/cloudcontrol_resource.html.markdown similarity index 100% rename from website/docs/r/cloudformation_resource.html.markdown rename to website/docs/r/cloudcontrol_resource.html.markdown From c0f95f959e8ce4561aea052bf92c5f7149138457 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 15 Sep 2021 17:11:05 -0400 Subject: [PATCH 13/33] Add new service 'cloudcontrolapi'. --- .github/labeler-issue-triage.yml | 2 ++ .github/labeler-pr-triage.yml | 4 ++++ aws/config.go | 3 +++ aws/provider.go | 1 + infrastructure/repository/labels-service.tf | 1 + website/allowed-subcategories.txt | 1 + website/docs/guides/custom-service-endpoints.html.md | 1 + 7 files changed, 13 insertions(+) diff --git a/.github/labeler-issue-triage.yml b/.github/labeler-issue-triage.yml index 18c61e211ab..8e5e7a01cc7 100644 --- a/.github/labeler-issue-triage.yml +++ b/.github/labeler-issue-triage.yml @@ -78,6 +78,8 @@ service/chime: - '((\*|-) ?`?|(data|resource) "?)aws_chime_' service/cloud9: - '((\*|-) ?`?|(data|resource) "?)aws_cloud9_' +service/cloudcontrolapi: + - '((\*|-) ?`?|(data|resource) "?)aws_cloudcontrolapi_' service/clouddirectory: - '((\*|-) ?`?|(data|resource) "?)aws_clouddirectory_' service/cloudformation: diff --git a/.github/labeler-pr-triage.yml b/.github/labeler-pr-triage.yml index 230a14da08a..3ce36577f39 100644 --- a/.github/labeler-pr-triage.yml +++ b/.github/labeler-pr-triage.yml @@ -131,6 +131,10 @@ service/cloud9: - 'aws/internal/service/cloud9/**/*' - '**/*_cloud9_*' - '**/cloud9_*' +service/cloudcontrolapi: + - 'aws/internal/service/cloudcontrolapi/**/*' + - '**/*_cloudcontrolapi_*' + - '**/cloudcontrolapi_*' service/clouddirectory: - 'aws/internal/service/clouddirectory/**/*' - '**/*_clouddirectory_*' diff --git a/aws/config.go b/aws/config.go index d77ab6f419c..e1de3978be5 100644 --- a/aws/config.go +++ b/aws/config.go @@ -30,6 +30,7 @@ import ( "github.com/aws/aws-sdk-go/service/budgets" "github.com/aws/aws-sdk-go/service/chime" "github.com/aws/aws-sdk-go/service/cloud9" + "github.com/aws/aws-sdk-go/service/cloudcontrolapi" "github.com/aws/aws-sdk-go/service/cloudformation" "github.com/aws/aws-sdk-go/service/cloudfront" "github.com/aws/aws-sdk-go/service/cloudhsmv2" @@ -242,6 +243,7 @@ type AWSClient struct { cfconn *cloudformation.CloudFormation chimeconn *chime.Chime cloud9conn *cloud9.Cloud9 + cloudcontrolapiconn *cloudcontrolapi.CloudControlApi cloudfrontconn *cloudfront.CloudFront cloudhsmv2conn *cloudhsmv2.CloudHSMV2 cloudsearchconn *cloudsearch.CloudSearch @@ -497,6 +499,7 @@ func (c *Config) Client() (interface{}, error) { cfconn: cloudformation.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["cloudformation"])})), chimeconn: chime.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["chime"])})), cloud9conn: cloud9.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["cloud9"])})), + cloudcontrolapiconn: cloudcontrolapi.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["cloudcontrolapi"])})), cloudfrontconn: cloudfront.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["cloudfront"])})), cloudhsmv2conn: cloudhsmv2.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["cloudhsm"])})), cloudsearchconn: cloudsearch.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["cloudsearch"])})), diff --git a/aws/provider.go b/aws/provider.go index ad16b087a2b..917ffe02942 100644 --- a/aws/provider.go +++ b/aws/provider.go @@ -1387,6 +1387,7 @@ func init() { "budgets", "chime", "cloud9", + "cloudcontrolapi", "cloudformation", "cloudfront", "cloudhsm", diff --git a/infrastructure/repository/labels-service.tf b/infrastructure/repository/labels-service.tf index 48ddbdc1100..613609f9e80 100644 --- a/infrastructure/repository/labels-service.tf +++ b/infrastructure/repository/labels-service.tf @@ -32,6 +32,7 @@ variable "service_labels" { "budgets", "chime", "cloud9", + "cloudcontrolapi", "clouddirectory", "cloudformation", "cloudfront", diff --git a/website/allowed-subcategories.txt b/website/allowed-subcategories.txt index 849f3300765..f5b9c77f76c 100644 --- a/website/allowed-subcategories.txt +++ b/website/allowed-subcategories.txt @@ -21,6 +21,7 @@ Batch Budgets Chime Cloud9 +Cloud Control API CloudFormation CloudFront CloudHSM v2 diff --git a/website/docs/guides/custom-service-endpoints.html.md b/website/docs/guides/custom-service-endpoints.html.md index 329da79920d..1ba83028fee 100644 --- a/website/docs/guides/custom-service-endpoints.html.md +++ b/website/docs/guides/custom-service-endpoints.html.md @@ -75,6 +75,7 @@ The Terraform AWS Provider allows the following endpoints to be customized:
  • budgets
  • chime
  • cloud9
  • +
  • cloudcontrolapi
  • cloudformation
  • cloudfront
  • cloudhsm
  • From 9418f9755f5982a5d818ea5ffb26e42280f82f3e Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 15 Sep 2021 17:13:19 -0400 Subject: [PATCH 14/33] Rename files 'cloudcontrol_resource' -> 'cloudcontrolapi_resource'. --- ...ol_resource.go => data_source_aws_cloudcontrolapi_resource.go} | 0 ...e_test.go => data_source_aws_cloudcontrolapi_resource_test.go} | 0 ...ntrol_resource.go => resource_aws_cloudcontrolapi_resource.go} | 0 ...urce_test.go => resource_aws_cloudcontrolapi_resource_test.go} | 0 ...ource.html.markdown => cloudcontrolapi_resource.html.markdown} | 0 ...ource.html.markdown => cloudcontrolapi_resource.html.markdown} | 0 6 files changed, 0 insertions(+), 0 deletions(-) rename aws/{data_source_aws_cloudcontrol_resource.go => data_source_aws_cloudcontrolapi_resource.go} (100%) rename aws/{data_source_aws_cloudcontrol_resource_test.go => data_source_aws_cloudcontrolapi_resource_test.go} (100%) rename aws/{resource_aws_cloudcontrol_resource.go => resource_aws_cloudcontrolapi_resource.go} (100%) rename aws/{resource_aws_cloudcontrol_resource_test.go => resource_aws_cloudcontrolapi_resource_test.go} (100%) rename website/docs/d/{cloudcontrol_resource.html.markdown => cloudcontrolapi_resource.html.markdown} (100%) rename website/docs/r/{cloudcontrol_resource.html.markdown => cloudcontrolapi_resource.html.markdown} (100%) diff --git a/aws/data_source_aws_cloudcontrol_resource.go b/aws/data_source_aws_cloudcontrolapi_resource.go similarity index 100% rename from aws/data_source_aws_cloudcontrol_resource.go rename to aws/data_source_aws_cloudcontrolapi_resource.go diff --git a/aws/data_source_aws_cloudcontrol_resource_test.go b/aws/data_source_aws_cloudcontrolapi_resource_test.go similarity index 100% rename from aws/data_source_aws_cloudcontrol_resource_test.go rename to aws/data_source_aws_cloudcontrolapi_resource_test.go diff --git a/aws/resource_aws_cloudcontrol_resource.go b/aws/resource_aws_cloudcontrolapi_resource.go similarity index 100% rename from aws/resource_aws_cloudcontrol_resource.go rename to aws/resource_aws_cloudcontrolapi_resource.go diff --git a/aws/resource_aws_cloudcontrol_resource_test.go b/aws/resource_aws_cloudcontrolapi_resource_test.go similarity index 100% rename from aws/resource_aws_cloudcontrol_resource_test.go rename to aws/resource_aws_cloudcontrolapi_resource_test.go diff --git a/website/docs/d/cloudcontrol_resource.html.markdown b/website/docs/d/cloudcontrolapi_resource.html.markdown similarity index 100% rename from website/docs/d/cloudcontrol_resource.html.markdown rename to website/docs/d/cloudcontrolapi_resource.html.markdown diff --git a/website/docs/r/cloudcontrol_resource.html.markdown b/website/docs/r/cloudcontrolapi_resource.html.markdown similarity index 100% rename from website/docs/r/cloudcontrol_resource.html.markdown rename to website/docs/r/cloudcontrolapi_resource.html.markdown From d40bafbee5d5a880ecc525cc93ec546b6adb1134 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 15 Sep 2021 17:45:59 -0400 Subject: [PATCH 15/33] Get the code building with new package. --- ...ata_source_aws_cloudcontrolapi_resource.go | 10 ++-- ...ource_aws_cloudcontrolapi_resource_test.go | 2 +- .../waiter/resource_request_status_status.go | 6 +-- .../waiter/resource_request_status_waiter.go | 12 ++--- aws/resource_aws_cloudcontrolapi_resource.go | 29 ++++++------ ...ource_aws_cloudcontrolapi_resource_test.go | 46 +++++++++---------- .../d/cloudcontrolapi_resource.html.markdown | 2 +- .../r/cloudcontrolapi_resource.html.markdown | 2 +- 8 files changed, 55 insertions(+), 54 deletions(-) rename aws/internal/service/{cloudformation => cloudcontrolapi}/waiter/resource_request_status_status.go (73%) rename aws/internal/service/{cloudformation => cloudcontrolapi}/waiter/resource_request_status_waiter.go (66%) diff --git a/aws/data_source_aws_cloudcontrolapi_resource.go b/aws/data_source_aws_cloudcontrolapi_resource.go index d41292d5ea2..c5a14188b27 100644 --- a/aws/data_source_aws_cloudcontrolapi_resource.go +++ b/aws/data_source_aws_cloudcontrolapi_resource.go @@ -6,7 +6,7 @@ import ( "regexp" "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/cloudformation" + "github.com/aws/aws-sdk-go/service/cloudcontrolapi" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" @@ -21,7 +21,7 @@ func dataSourceAwsCloudFormationResource() *schema.Resource { Type: schema.TypeString, Required: true, }, - "resource_model": { + "properties": { Type: schema.TypeString, Computed: true, }, @@ -43,9 +43,9 @@ func dataSourceAwsCloudFormationResource() *schema.Resource { } func dataSourceAwsCloudformationResourceRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - conn := meta.(*AWSClient).cfconn + conn := meta.(*AWSClient).cloudcontrolapiconn - input := &cloudformation.GetResourceInput{} + input := &cloudcontrolapi.GetResourceInput{} if v, ok := d.GetOk("identifier"); ok { input.Identifier = aws.String(v.(string)) @@ -75,7 +75,7 @@ func dataSourceAwsCloudformationResourceRead(ctx context.Context, d *schema.Reso d.SetId(aws.StringValue(output.ResourceDescription.Identifier)) - d.Set("resource_model", output.ResourceDescription.ResourceModel) + d.Set("properties", output.ResourceDescription.Properties) return nil } diff --git a/aws/data_source_aws_cloudcontrolapi_resource_test.go b/aws/data_source_aws_cloudcontrolapi_resource_test.go index b3271b73bf7..d943e0e9456 100644 --- a/aws/data_source_aws_cloudcontrolapi_resource_test.go +++ b/aws/data_source_aws_cloudcontrolapi_resource_test.go @@ -24,7 +24,7 @@ func TestAccAwsCloudformationResourceDataSource_basic(t *testing.T) { Config: testAccAwsCloudformationResourceDataSourceConfig(rName), Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttrPair(dataSourceName, "id", resourceName, "id"), - resource.TestCheckResourceAttrPair(dataSourceName, "resource_model", resourceName, "resource_model"), + resource.TestCheckResourceAttrPair(dataSourceName, "properties", resourceName, "properties"), resource.TestCheckResourceAttrPair(dataSourceName, "type_name", resourceName, "type_name"), ), }, diff --git a/aws/internal/service/cloudformation/waiter/resource_request_status_status.go b/aws/internal/service/cloudcontrolapi/waiter/resource_request_status_status.go similarity index 73% rename from aws/internal/service/cloudformation/waiter/resource_request_status_status.go rename to aws/internal/service/cloudcontrolapi/waiter/resource_request_status_status.go index 083621b74f4..6942c58bbda 100644 --- a/aws/internal/service/cloudformation/waiter/resource_request_status_status.go +++ b/aws/internal/service/cloudcontrolapi/waiter/resource_request_status_status.go @@ -4,13 +4,13 @@ import ( "context" "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/cloudformation" + "github.com/aws/aws-sdk-go/service/cloudcontrolapi" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) -func ResourceRequestStatusProgressEventOperationStatus(ctx context.Context, conn *cloudformation.CloudFormation, requestToken string) resource.StateRefreshFunc { +func ResourceRequestStatusProgressEventOperationStatus(ctx context.Context, conn *cloudcontrolapi.CloudControlApi, requestToken string) resource.StateRefreshFunc { return func() (interface{}, string, error) { - input := &cloudformation.GetResourceRequestStatusInput{ + input := &cloudcontrolapi.GetResourceRequestStatusInput{ RequestToken: aws.String(requestToken), } diff --git a/aws/internal/service/cloudformation/waiter/resource_request_status_waiter.go b/aws/internal/service/cloudcontrolapi/waiter/resource_request_status_waiter.go similarity index 66% rename from aws/internal/service/cloudformation/waiter/resource_request_status_waiter.go rename to aws/internal/service/cloudcontrolapi/waiter/resource_request_status_waiter.go index 8e4d42b684e..4d4517b0555 100644 --- a/aws/internal/service/cloudformation/waiter/resource_request_status_waiter.go +++ b/aws/internal/service/cloudcontrolapi/waiter/resource_request_status_waiter.go @@ -6,24 +6,24 @@ import ( "fmt" "time" - "github.com/aws/aws-sdk-go/service/cloudformation" + "github.com/aws/aws-sdk-go/service/cloudcontrolapi" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) -func ResourceRequestStatusProgressEventOperationStatusSuccess(ctx context.Context, conn *cloudformation.CloudFormation, requestToken string, timeout time.Duration) (*cloudformation.ProgressEvent, error) { +func ResourceRequestStatusProgressEventOperationStatusSuccess(ctx context.Context, conn *cloudcontrolapi.CloudControlApi, requestToken string, timeout time.Duration) (*cloudcontrolapi.ProgressEvent, error) { stateConf := &resource.StateChangeConf{ Pending: []string{ - cloudformation.OperationStatusInProgress, - cloudformation.OperationStatusPending, + cloudcontrolapi.OperationStatusInProgress, + cloudcontrolapi.OperationStatusPending, }, - Target: []string{cloudformation.OperationStatusSuccess}, + Target: []string{cloudcontrolapi.OperationStatusSuccess}, Refresh: ResourceRequestStatusProgressEventOperationStatus(ctx, conn, requestToken), Timeout: timeout, } outputRaw, err := stateConf.WaitForStateContext(ctx) - if output, ok := outputRaw.(*cloudformation.ProgressEvent); ok { + if output, ok := outputRaw.(*cloudcontrolapi.ProgressEvent); ok { if err != nil && output != nil { newErr := fmt.Errorf("%s", output) diff --git a/aws/resource_aws_cloudcontrolapi_resource.go b/aws/resource_aws_cloudcontrolapi_resource.go index a03af21b42c..af81fbe67a5 100644 --- a/aws/resource_aws_cloudcontrolapi_resource.go +++ b/aws/resource_aws_cloudcontrolapi_resource.go @@ -9,6 +9,7 @@ import ( "time" "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/cloudcontrolapi" "github.com/aws/aws-sdk-go/service/cloudformation" cfschema "github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go" "github.com/hashicorp/aws-sdk-go-base/tfawserr" @@ -18,7 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/mattbaird/jsonpatch" - "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/cloudformation/waiter" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/cloudcontrolapi/waiter" ) func resourceAwsCloudFormationResource() *schema.Resource { @@ -39,7 +40,7 @@ func resourceAwsCloudFormationResource() *schema.Resource { Type: schema.TypeString, Required: true, }, - "resource_model": { + "properties": { Type: schema.TypeString, Computed: true, }, @@ -68,7 +69,7 @@ func resourceAwsCloudFormationResource() *schema.Resource { CustomizeDiff: customdiff.Sequence( resourceAwsCloudFormationResourceCustomizeDiffGetSchema, resourceAwsCloudFormationResourceCustomizeDiffSchemaDiff, - customdiff.ComputedIf("resource_model", func(ctx context.Context, diff *schema.ResourceDiff, meta interface{}) bool { + customdiff.ComputedIf("properties", func(ctx context.Context, diff *schema.ResourceDiff, meta interface{}) bool { return diff.HasChange("desired_state") }), ), @@ -76,9 +77,9 @@ func resourceAwsCloudFormationResource() *schema.Resource { } func resourceAwsCloudFormationResourceCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - conn := meta.(*AWSClient).cfconn + conn := meta.(*AWSClient).cloudcontrolapiconn - input := &cloudformation.CreateResourceInput{ + input := &cloudcontrolapi.CreateResourceInput{ ClientToken: aws.String(resource.UniqueId()), } @@ -126,9 +127,9 @@ func resourceAwsCloudFormationResourceCreate(ctx context.Context, d *schema.Reso } func resourceAwsCloudFormationResourceRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - conn := meta.(*AWSClient).cfconn + conn := meta.(*AWSClient).cloudcontrolapiconn - input := &cloudformation.GetResourceInput{ + input := &cloudcontrolapi.GetResourceInput{ Identifier: aws.String(d.Id()), } @@ -146,7 +147,7 @@ func resourceAwsCloudFormationResourceRead(ctx context.Context, d *schema.Resour output, err := conn.GetResourceWithContext(ctx, input) - if tfawserr.ErrCodeEquals(err, cloudformation.ErrCodeResourceNotFoundException) { + if tfawserr.ErrCodeEquals(err, cloudcontrolapi.ErrCodeResourceNotFoundException) { if d.IsNewResource() { return diag.FromErr(fmt.Errorf("error reading CloudFormation Resource (%s): not found after creation", d.Id())) } @@ -164,13 +165,13 @@ func resourceAwsCloudFormationResourceRead(ctx context.Context, d *schema.Resour return diag.FromErr(fmt.Errorf("error reading CloudFormation Resource (%s): empty response", d.Id())) } - d.Set("resource_model", output.ResourceDescription.ResourceModel) + d.Set("properties", output.ResourceDescription.Properties) return nil } func resourceAwsCloudFormationResourceUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - conn := meta.(*AWSClient).cfconn + conn := meta.(*AWSClient).cloudcontrolapiconn if d.HasChange("desired_state") { oldRaw, newRaw := d.GetChange("desired_state") @@ -187,7 +188,7 @@ func resourceAwsCloudFormationResourceUpdate(ctx context.Context, d *schema.Reso } } - input := &cloudformation.UpdateResourceInput{ + input := &cloudcontrolapi.UpdateResourceInput{ ClientToken: aws.String(resource.UniqueId()), Identifier: aws.String(d.Id()), PatchDocument: aws.String(patchDocument), @@ -224,9 +225,9 @@ func resourceAwsCloudFormationResourceUpdate(ctx context.Context, d *schema.Reso } func resourceAwsCloudFormationResourceDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - conn := meta.(*AWSClient).cfconn + conn := meta.(*AWSClient).cloudcontrolapiconn - input := &cloudformation.DeleteResourceInput{ + input := &cloudcontrolapi.DeleteResourceInput{ ClientToken: aws.String(resource.UniqueId()), Identifier: aws.String(d.Id()), } @@ -255,7 +256,7 @@ func resourceAwsCloudFormationResourceDelete(ctx context.Context, d *schema.Reso progressEvent, err := waiter.ResourceRequestStatusProgressEventOperationStatusSuccess(ctx, conn, aws.StringValue(output.ProgressEvent.RequestToken), d.Timeout(schema.TimeoutDelete)) - if progressEvent != nil && aws.StringValue(progressEvent.ErrorCode) == cloudformation.HandlerErrorCodeNotFound { + if progressEvent != nil && aws.StringValue(progressEvent.ErrorCode) == cloudcontrolapi.HandlerErrorCodeNotFound { return nil } diff --git a/aws/resource_aws_cloudcontrolapi_resource_test.go b/aws/resource_aws_cloudcontrolapi_resource_test.go index 93b7fce79a4..b18e16bea13 100644 --- a/aws/resource_aws_cloudcontrolapi_resource_test.go +++ b/aws/resource_aws_cloudcontrolapi_resource_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/cloudformation" + "github.com/aws/aws-sdk-go/service/cloudcontrolapi" "github.com/hashicorp/aws-sdk-go-base/tfawserr" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -19,7 +19,7 @@ func TestAccAwsCloudformationResource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), + ErrorCheck: testAccErrorCheck(t, cloudcontrolapi.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, Steps: []resource.TestStep{ @@ -40,7 +40,7 @@ func TestAccAwsCloudformationResource_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), + ErrorCheck: testAccErrorCheck(t, cloudcontrolapi.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, Steps: []resource.TestStep{ @@ -61,7 +61,7 @@ func TestAccAwsCloudformationResource_DesiredState_BooleanValueAdded(t *testing. resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), + ErrorCheck: testAccErrorCheck(t, cloudcontrolapi.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, Steps: []resource.TestStep{ @@ -87,7 +87,7 @@ func TestAccAwsCloudformationResource_DesiredState_BooleanValueRemoved(t *testin resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), + ErrorCheck: testAccErrorCheck(t, cloudcontrolapi.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, Steps: []resource.TestStep{ @@ -113,7 +113,7 @@ func TestAccAwsCloudformationResource_DesiredState_BooleanValueUpdate(t *testing resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), + ErrorCheck: testAccErrorCheck(t, cloudcontrolapi.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, Steps: []resource.TestStep{ @@ -140,7 +140,7 @@ func TestAccAwsCloudformationResource_DesiredState_CreateOnly(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), + ErrorCheck: testAccErrorCheck(t, cloudcontrolapi.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, Steps: []resource.TestStep{ @@ -166,7 +166,7 @@ func TestAccAwsCloudformationResource_DesiredState_IntegerValueAdded(t *testing. resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), + ErrorCheck: testAccErrorCheck(t, cloudcontrolapi.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, Steps: []resource.TestStep{ @@ -192,7 +192,7 @@ func TestAccAwsCloudformationResource_DesiredState_IntegerValueRemoved(t *testin resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), + ErrorCheck: testAccErrorCheck(t, cloudcontrolapi.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, Steps: []resource.TestStep{ @@ -218,7 +218,7 @@ func TestAccAwsCloudformationResource_DesiredState_IntegerValueUpdate(t *testing resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), + ErrorCheck: testAccErrorCheck(t, cloudcontrolapi.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, Steps: []resource.TestStep{ @@ -243,7 +243,7 @@ func TestAccAwsCloudformationResource_DesiredState_InvalidPropertyName(t *testin resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), + ErrorCheck: testAccErrorCheck(t, cloudcontrolapi.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, Steps: []resource.TestStep{ @@ -260,7 +260,7 @@ func TestAccAwsCloudformationResource_DesiredState_InvalidPropertyValue(t *testi resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), + ErrorCheck: testAccErrorCheck(t, cloudcontrolapi.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, Steps: []resource.TestStep{ @@ -278,7 +278,7 @@ func TestAccAwsCloudformationResource_DesiredState_ObjectValueAdded(t *testing.T resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), + ErrorCheck: testAccErrorCheck(t, cloudcontrolapi.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, Steps: []resource.TestStep{ @@ -304,7 +304,7 @@ func TestAccAwsCloudformationResource_DesiredState_ObjectValueRemoved(t *testing resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), + ErrorCheck: testAccErrorCheck(t, cloudcontrolapi.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, Steps: []resource.TestStep{ @@ -330,7 +330,7 @@ func TestAccAwsCloudformationResource_DesiredState_ObjectValueUpdate(t *testing. resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), + ErrorCheck: testAccErrorCheck(t, cloudcontrolapi.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, Steps: []resource.TestStep{ @@ -362,7 +362,7 @@ func TestAccAwsCloudformationResource_DesiredState_StringValueAdded(t *testing.T resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), + ErrorCheck: testAccErrorCheck(t, cloudcontrolapi.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, Steps: []resource.TestStep{ @@ -388,7 +388,7 @@ func TestAccAwsCloudformationResource_DesiredState_StringValueRemoved(t *testing resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), + ErrorCheck: testAccErrorCheck(t, cloudcontrolapi.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, Steps: []resource.TestStep{ @@ -414,7 +414,7 @@ func TestAccAwsCloudformationResource_DesiredState_StringValueUpdate(t *testing. resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), + ErrorCheck: testAccErrorCheck(t, cloudcontrolapi.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, Steps: []resource.TestStep{ @@ -440,7 +440,7 @@ func TestAccAwsCloudformationResource_ResourceSchema(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), + ErrorCheck: testAccErrorCheck(t, cloudcontrolapi.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, Steps: []resource.TestStep{ @@ -455,21 +455,21 @@ func TestAccAwsCloudformationResource_ResourceSchema(t *testing.T) { } func testAccCheckAwsCloudformationResourceDestroy(s *terraform.State) error { - conn := testAccProvider.Meta().(*AWSClient).cfconn + conn := testAccProvider.Meta().(*AWSClient).cloudcontrolapiconn for _, rs := range s.RootModule().Resources { if rs.Type != "aws_cloudformation_resource" { continue } - input := &cloudformation.GetResourceInput{ + input := &cloudcontrolapi.GetResourceInput{ Identifier: aws.String(rs.Primary.ID), TypeName: aws.String(rs.Primary.Attributes["type_name"]), } _, err := conn.GetResource(input) - if tfawserr.ErrCodeEquals(err, cloudformation.ErrCodeResourceNotFoundException) { + if tfawserr.ErrCodeEquals(err, cloudcontrolapi.ErrCodeResourceNotFoundException) { continue } @@ -477,7 +477,7 @@ func testAccCheckAwsCloudformationResourceDestroy(s *terraform.State) error { // "not found" errors, instead returning a HandlerFailureException. // These should be reported and fixed upstream over time, but for now // work around the issue only in CheckDestroy. - if tfawserr.ErrMessageContains(err, cloudformation.ErrCodeHandlerFailureException, "not found") { + if tfawserr.ErrMessageContains(err, cloudcontrolapi.ErrCodeHandlerFailureException, "not found") { continue } diff --git a/website/docs/d/cloudcontrolapi_resource.html.markdown b/website/docs/d/cloudcontrolapi_resource.html.markdown index 4985c6ef61f..8ac6e2b4509 100644 --- a/website/docs/d/cloudcontrolapi_resource.html.markdown +++ b/website/docs/d/cloudcontrolapi_resource.html.markdown @@ -35,4 +35,4 @@ The following arguments are optional: In addition to all arguments above, the following attributes are exported: -* `resource_model` - JSON string matching the CloudFormation resource type schema with current configuration. Underlying attributes can be referenced via the [`jsondecode()` function](https://www.terraform.io/docs/language/functions/jsondecode.html), for example, `jsondecode(data.aws_cloudformation_resource.example.resource_model)["example"]`. +* `properties` - JSON string matching the CloudFormation resource type schema with current configuration. Underlying attributes can be referenced via the [`jsondecode()` function](https://www.terraform.io/docs/language/functions/jsondecode.html), for example, `jsondecode(data.aws_cloudformation_resource.example.properties)["example"]`. diff --git a/website/docs/r/cloudcontrolapi_resource.html.markdown b/website/docs/r/cloudcontrolapi_resource.html.markdown index 445cacad5da..afcf4cccffa 100644 --- a/website/docs/r/cloudcontrolapi_resource.html.markdown +++ b/website/docs/r/cloudcontrolapi_resource.html.markdown @@ -45,4 +45,4 @@ The following arguments are optional: In addition to all arguments above, the following attributes are exported: -* `resource_model` - JSON string matching the CloudFormation resource type schema with current configuration. Underlying attributes can be referenced via the [`jsondecode()` function](https://www.terraform.io/docs/language/functions/jsondecode.html), for example, `jsondecode(data.aws_cloudformation_resource.example.resource_model)["example"]`. +* `properties` - JSON string matching the CloudFormation resource type schema with current configuration. Underlying attributes can be referenced via the [`jsondecode()` function](https://www.terraform.io/docs/language/functions/jsondecode.html), for example, `jsondecode(data.aws_cloudformation_resource.example.properties)["example"]`. From d7c44e83fbaa97fbae8b9a6b9f830171da54fc57 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 15 Sep 2021 17:48:10 -0400 Subject: [PATCH 16/33] Run 'GOPRIVATE=github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go go get github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go@v0.9.0'. --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index b48deef0845..cebc1eeb813 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/beevik/etree v1.1.0 github.com/evanphx/json-patch v0.5.2 // indirect github.com/fatih/color v1.9.0 // indirect - github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.1.0 + github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.9.0 github.com/hashicorp/aws-sdk-go-base v1.0.0 github.com/hashicorp/go-cleanhttp v0.5.2 github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 diff --git a/go.sum b/go.sum index 89a12d7c6c7..f2fb72557be 100644 --- a/go.sum +++ b/go.sum @@ -162,8 +162,8 @@ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.1.0 h1:L9otHY+jGNNTr2zhDwiYSSWGCyCcNckvETR/KcWxYV8= -github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.1.0/go.mod h1:C6GVuO9RWOrt6QCGTmLCOYuSHpkfQSBDuRqTteOlo0g= +github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.9.0 h1:tmfUGbj6/nQxYZJWmUoY0NoGMLZBgDcyl+OlH9+vbcE= +github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.9.0/go.mod h1:C6GVuO9RWOrt6QCGTmLCOYuSHpkfQSBDuRqTteOlo0g= github.com/hashicorp/aws-sdk-go-base v0.7.1 h1:7s/aR3hFn74tYPVihzDyZe7y/+BorN70rr9ZvpV3j3o= github.com/hashicorp/aws-sdk-go-base v0.7.1/go.mod h1:2fRjWDv3jJBeN6mVWFHV6hFTNeFBx2gpDLQaZNxUVAY= github.com/hashicorp/aws-sdk-go-private v1.40.42-0.20210915192203-499245543dfd h1:F8kyugZaV1xu7PWOqezDdeVNZxL2pG9KhGTOxnXyjzE= From 4928d3390a04952b4557e0f63b7a8fdcf2a147b4 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 16 Sep 2021 08:27:58 -0400 Subject: [PATCH 17/33] Rename functions 'CloudFormationResource' -> 'CloudControlApiResource'. --- ...ata_source_aws_cloudcontrolapi_resource.go | 6 +- ...ource_aws_cloudcontrolapi_resource_test.go | 12 +- aws/provider.go | 3 +- aws/resource_aws_cloudcontrolapi_resource.go | 30 +-- ...ource_aws_cloudcontrolapi_resource_test.go | 225 +++++++++--------- 5 files changed, 139 insertions(+), 137 deletions(-) diff --git a/aws/data_source_aws_cloudcontrolapi_resource.go b/aws/data_source_aws_cloudcontrolapi_resource.go index c5a14188b27..06bcae69fa9 100644 --- a/aws/data_source_aws_cloudcontrolapi_resource.go +++ b/aws/data_source_aws_cloudcontrolapi_resource.go @@ -12,9 +12,9 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) -func dataSourceAwsCloudFormationResource() *schema.Resource { +func dataSourceAwsCloudControlApiResource() *schema.Resource { return &schema.Resource{ - ReadContext: dataSourceAwsCloudformationResourceRead, + ReadContext: dataSourceAwsCloudControlApiResourceRead, Schema: map[string]*schema.Schema{ "identifier": { @@ -42,7 +42,7 @@ func dataSourceAwsCloudFormationResource() *schema.Resource { } } -func dataSourceAwsCloudformationResourceRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { +func dataSourceAwsCloudControlApiResourceRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { conn := meta.(*AWSClient).cloudcontrolapiconn input := &cloudcontrolapi.GetResourceInput{} diff --git a/aws/data_source_aws_cloudcontrolapi_resource_test.go b/aws/data_source_aws_cloudcontrolapi_resource_test.go index d943e0e9456..44daefb4504 100644 --- a/aws/data_source_aws_cloudcontrolapi_resource_test.go +++ b/aws/data_source_aws_cloudcontrolapi_resource_test.go @@ -4,24 +4,24 @@ import ( "fmt" "testing" - "github.com/aws/aws-sdk-go/service/cloudformation" + "github.com/aws/aws-sdk-go/service/cloudcontrolapi" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) -func TestAccAwsCloudformationResourceDataSource_basic(t *testing.T) { +func TestAccAwsCloudControlApiResourceDataSource_basic(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") dataSourceName := "data.aws_cloudformation_resource.test" resourceName := "aws_cloudformation_resource.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), + ErrorCheck: testAccErrorCheck(t, cloudcontrolapi.EndpointsID), ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, + CheckDestroy: testAccCheckAwsCloudControlApiResourceDestroy, Steps: []resource.TestStep{ { - Config: testAccAwsCloudformationResourceDataSourceConfig(rName), + Config: testAccAwsCloudControlApiResourceDataSourceConfig(rName), Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttrPair(dataSourceName, "id", resourceName, "id"), resource.TestCheckResourceAttrPair(dataSourceName, "properties", resourceName, "properties"), @@ -32,7 +32,7 @@ func TestAccAwsCloudformationResourceDataSource_basic(t *testing.T) { }) } -func testAccAwsCloudformationResourceDataSourceConfig(rName string) string { +func testAccAwsCloudControlApiResourceDataSourceConfig(rName string) string { return fmt.Sprintf(` resource "aws_cloudformation_resource" "test" { type_name = "AWS::Logs::LogGroup" diff --git a/aws/provider.go b/aws/provider.go index 917ffe02942..18a2f9bbc44 100644 --- a/aws/provider.go +++ b/aws/provider.go @@ -217,8 +217,8 @@ func Provider() *schema.Provider { "aws_billing_service_account": dataSourceAwsBillingServiceAccount(), "aws_caller_identity": dataSourceAwsCallerIdentity(), "aws_canonical_user_id": dataSourceAwsCanonicalUserId(), + "aws_cloudcontrolapi_resource": dataSourceAwsCloudControlApiResource(), "aws_cloudformation_export": dataSourceAwsCloudFormationExport(), - "aws_cloudformation_resource": dataSourceAwsCloudFormationResource(), "aws_cloudformation_stack": dataSourceAwsCloudFormationStack(), "aws_cloudformation_type": dataSourceAwsCloudFormationType(), "aws_cloudfront_cache_policy": dataSourceAwsCloudFrontCachePolicy(), @@ -584,6 +584,7 @@ func Provider() *schema.Provider { "aws_chime_voice_connector_origination": resourceAwsChimeVoiceConnectorOrigination(), "aws_chime_voice_connector_termination": resourceAwsChimeVoiceConnectorTermination(), "aws_cloud9_environment_ec2": resourceAwsCloud9EnvironmentEc2(), + "aws_cloudcontrolapi_resource": resourceAwsCloudControlApiResource(), "aws_cloudformation_stack": resourceAwsCloudFormationStack(), "aws_cloudformation_stack_set": resourceAwsCloudFormationStackSet(), "aws_cloudformation_stack_set_instance": resourceAwsCloudFormationStackSetInstance(), diff --git a/aws/resource_aws_cloudcontrolapi_resource.go b/aws/resource_aws_cloudcontrolapi_resource.go index af81fbe67a5..2b6241c821d 100644 --- a/aws/resource_aws_cloudcontrolapi_resource.go +++ b/aws/resource_aws_cloudcontrolapi_resource.go @@ -22,12 +22,12 @@ import ( "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/cloudcontrolapi/waiter" ) -func resourceAwsCloudFormationResource() *schema.Resource { +func resourceAwsCloudControlApiResource() *schema.Resource { return &schema.Resource{ - CreateContext: resourceAwsCloudFormationResourceCreate, - DeleteContext: resourceAwsCloudFormationResourceDelete, - ReadContext: resourceAwsCloudFormationResourceRead, - UpdateContext: resourceAwsCloudFormationResourceUpdate, + CreateContext: resourceAwsCloudControlApiResourceCreate, + DeleteContext: resourceAwsCloudControlApiResourceDelete, + ReadContext: resourceAwsCloudControlApiResourceRead, + UpdateContext: resourceAwsCloudControlApiResourceUpdate, Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(2 * time.Hour), @@ -67,8 +67,8 @@ func resourceAwsCloudFormationResource() *schema.Resource { }, CustomizeDiff: customdiff.Sequence( - resourceAwsCloudFormationResourceCustomizeDiffGetSchema, - resourceAwsCloudFormationResourceCustomizeDiffSchemaDiff, + resourceAwsCloudControlApiResourceCustomizeDiffGetSchema, + resourceAwsCloudControlApiResourceCustomizeDiffSchemaDiff, customdiff.ComputedIf("properties", func(ctx context.Context, diff *schema.ResourceDiff, meta interface{}) bool { return diff.HasChange("desired_state") }), @@ -76,7 +76,7 @@ func resourceAwsCloudFormationResource() *schema.Resource { } } -func resourceAwsCloudFormationResourceCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { +func resourceAwsCloudControlApiResourceCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { conn := meta.(*AWSClient).cloudcontrolapiconn input := &cloudcontrolapi.CreateResourceInput{ @@ -123,10 +123,10 @@ func resourceAwsCloudFormationResourceCreate(ctx context.Context, d *schema.Reso d.SetId(aws.StringValue(output.ProgressEvent.Identifier)) } - return resourceAwsCloudFormationResourceRead(ctx, d, meta) + return resourceAwsCloudControlApiResourceRead(ctx, d, meta) } -func resourceAwsCloudFormationResourceRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { +func resourceAwsCloudControlApiResourceRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { conn := meta.(*AWSClient).cloudcontrolapiconn input := &cloudcontrolapi.GetResourceInput{ @@ -170,7 +170,7 @@ func resourceAwsCloudFormationResourceRead(ctx context.Context, d *schema.Resour return nil } -func resourceAwsCloudFormationResourceUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { +func resourceAwsCloudControlApiResourceUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { conn := meta.(*AWSClient).cloudcontrolapiconn if d.HasChange("desired_state") { @@ -221,10 +221,10 @@ func resourceAwsCloudFormationResourceUpdate(ctx context.Context, d *schema.Reso } } - return resourceAwsCloudFormationResourceRead(ctx, d, meta) + return resourceAwsCloudControlApiResourceRead(ctx, d, meta) } -func resourceAwsCloudFormationResourceDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { +func resourceAwsCloudControlApiResourceDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { conn := meta.(*AWSClient).cloudcontrolapiconn input := &cloudcontrolapi.DeleteResourceInput{ @@ -267,7 +267,7 @@ func resourceAwsCloudFormationResourceDelete(ctx context.Context, d *schema.Reso return nil } -func resourceAwsCloudFormationResourceCustomizeDiffGetSchema(ctx context.Context, diff *schema.ResourceDiff, meta interface{}) error { +func resourceAwsCloudControlApiResourceCustomizeDiffGetSchema(ctx context.Context, diff *schema.ResourceDiff, meta interface{}) error { conn := meta.(*AWSClient).cfconn resourceSchema := diff.Get("schema").(string) @@ -299,7 +299,7 @@ func resourceAwsCloudFormationResourceCustomizeDiffGetSchema(ctx context.Context return nil } -func resourceAwsCloudFormationResourceCustomizeDiffSchemaDiff(ctx context.Context, diff *schema.ResourceDiff, meta interface{}) error { +func resourceAwsCloudControlApiResourceCustomizeDiffSchemaDiff(ctx context.Context, diff *schema.ResourceDiff, meta interface{}) error { oldDesiredStateRaw, newDesiredStateRaw := diff.GetChange("desired_state") newSchema := diff.Get("schema").(string) diff --git a/aws/resource_aws_cloudcontrolapi_resource_test.go b/aws/resource_aws_cloudcontrolapi_resource_test.go index b18e16bea13..980541a564a 100644 --- a/aws/resource_aws_cloudcontrolapi_resource_test.go +++ b/aws/resource_aws_cloudcontrolapi_resource_test.go @@ -7,13 +7,14 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudcontrolapi" + "github.com/aws/aws-sdk-go/service/cloudformation" "github.com/hashicorp/aws-sdk-go-base/tfawserr" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) -func TestAccAwsCloudformationResource_basic(t *testing.T) { +func TestAccAwsCloudControlApiResource_basic(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_cloudformation_resource.test" @@ -21,12 +22,12 @@ func TestAccAwsCloudformationResource_basic(t *testing.T) { PreCheck: func() { testAccPreCheck(t) }, ErrorCheck: testAccErrorCheck(t, cloudcontrolapi.EndpointsID), ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, + CheckDestroy: testAccCheckAwsCloudControlApiResourceDestroy, Steps: []resource.TestStep{ { - Config: testAccAwsCloudformationResourceConfig(rName), + Config: testAccAwsCloudControlApiResourceConfig(rName), Check: resource.ComposeAggregateTestCheckFunc( - resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`^\{.*\}$`)), + resource.TestMatchResourceAttr(resourceName, "properties", regexp.MustCompile(`^\{.*\}$`)), resource.TestMatchResourceAttr(resourceName, "schema", regexp.MustCompile(`^\{.*`)), ), }, @@ -34,7 +35,7 @@ func TestAccAwsCloudformationResource_basic(t *testing.T) { }) } -func TestAccAwsCloudformationResource_disappears(t *testing.T) { +func TestAccAwsCloudControlApiResource_disappears(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_cloudformation_resource.test" @@ -42,12 +43,12 @@ func TestAccAwsCloudformationResource_disappears(t *testing.T) { PreCheck: func() { testAccPreCheck(t) }, ErrorCheck: testAccErrorCheck(t, cloudcontrolapi.EndpointsID), ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, + CheckDestroy: testAccCheckAwsCloudControlApiResourceDestroy, Steps: []resource.TestStep{ { - Config: testAccAwsCloudformationResourceConfig(rName), + Config: testAccAwsCloudControlApiResourceConfig(rName), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckResourceDisappears(testAccProvider, resourceAwsCloudFormationResource(), resourceName), + testAccCheckResourceDisappears(testAccProvider, resourceAwsCloudControlApiResource(), resourceName), ), ExpectNonEmptyPlan: true, }, @@ -55,7 +56,7 @@ func TestAccAwsCloudformationResource_disappears(t *testing.T) { }) } -func TestAccAwsCloudformationResource_DesiredState_BooleanValueAdded(t *testing.T) { +func TestAccAwsCloudControlApiResource_DesiredState_BooleanValueAdded(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_cloudformation_resource.test" @@ -63,25 +64,25 @@ func TestAccAwsCloudformationResource_DesiredState_BooleanValueAdded(t *testing. PreCheck: func() { testAccPreCheck(t) }, ErrorCheck: testAccErrorCheck(t, cloudcontrolapi.EndpointsID), ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, + CheckDestroy: testAccCheckAwsCloudControlApiResourceDestroy, Steps: []resource.TestStep{ { - Config: testAccAwsCloudformationResourceConfigDesiredStateBooleanValueRemoved(rName), + Config: testAccAwsCloudControlApiResourceConfigDesiredStateBooleanValueRemoved(rName), Check: resource.ComposeAggregateTestCheckFunc( - resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"Enabled":false`)), + resource.TestMatchResourceAttr(resourceName, "properties", regexp.MustCompile(`"Enabled":false`)), ), }, { - Config: testAccAwsCloudformationResourceConfigDesiredStateBooleanValue(rName, true), + Config: testAccAwsCloudControlApiResourceConfigDesiredStateBooleanValue(rName, true), Check: resource.ComposeAggregateTestCheckFunc( - resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"Enabled":true`)), + resource.TestMatchResourceAttr(resourceName, "properties", regexp.MustCompile(`"Enabled":true`)), ), }, }, }) } -func TestAccAwsCloudformationResource_DesiredState_BooleanValueRemoved(t *testing.T) { +func TestAccAwsCloudControlApiResource_DesiredState_BooleanValueRemoved(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_cloudformation_resource.test" @@ -89,25 +90,25 @@ func TestAccAwsCloudformationResource_DesiredState_BooleanValueRemoved(t *testin PreCheck: func() { testAccPreCheck(t) }, ErrorCheck: testAccErrorCheck(t, cloudcontrolapi.EndpointsID), ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, + CheckDestroy: testAccCheckAwsCloudControlApiResourceDestroy, Steps: []resource.TestStep{ { - Config: testAccAwsCloudformationResourceConfigDesiredStateBooleanValue(rName, true), + Config: testAccAwsCloudControlApiResourceConfigDesiredStateBooleanValue(rName, true), Check: resource.ComposeAggregateTestCheckFunc( - resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"Enabled":true`)), + resource.TestMatchResourceAttr(resourceName, "properties", regexp.MustCompile(`"Enabled":true`)), ), }, { - Config: testAccAwsCloudformationResourceConfigDesiredStateBooleanValueRemoved(rName), + Config: testAccAwsCloudControlApiResourceConfigDesiredStateBooleanValueRemoved(rName), Check: resource.ComposeAggregateTestCheckFunc( - resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"Enabled":false`)), + resource.TestMatchResourceAttr(resourceName, "properties", regexp.MustCompile(`"Enabled":false`)), ), }, }, }) } -func TestAccAwsCloudformationResource_DesiredState_BooleanValueUpdate(t *testing.T) { +func TestAccAwsCloudControlApiResource_DesiredState_BooleanValueUpdate(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_cloudformation_resource.test" @@ -115,25 +116,25 @@ func TestAccAwsCloudformationResource_DesiredState_BooleanValueUpdate(t *testing PreCheck: func() { testAccPreCheck(t) }, ErrorCheck: testAccErrorCheck(t, cloudcontrolapi.EndpointsID), ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, + CheckDestroy: testAccCheckAwsCloudControlApiResourceDestroy, Steps: []resource.TestStep{ { - Config: testAccAwsCloudformationResourceConfigDesiredStateBooleanValue(rName, true), + Config: testAccAwsCloudControlApiResourceConfigDesiredStateBooleanValue(rName, true), Check: resource.ComposeAggregateTestCheckFunc( - resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"Enabled":true`)), + resource.TestMatchResourceAttr(resourceName, "properties", regexp.MustCompile(`"Enabled":true`)), ), }, { - Config: testAccAwsCloudformationResourceConfigDesiredStateBooleanValue(rName, false), + Config: testAccAwsCloudControlApiResourceConfigDesiredStateBooleanValue(rName, false), Check: resource.ComposeAggregateTestCheckFunc( - resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"Enabled":false`)), + resource.TestMatchResourceAttr(resourceName, "properties", regexp.MustCompile(`"Enabled":false`)), ), }, }, }) } -func TestAccAwsCloudformationResource_DesiredState_CreateOnly(t *testing.T) { +func TestAccAwsCloudControlApiResource_DesiredState_CreateOnly(t *testing.T) { rName1 := acctest.RandomWithPrefix("tf-acc-test") rName2 := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_cloudformation_resource.test" @@ -142,25 +143,25 @@ func TestAccAwsCloudformationResource_DesiredState_CreateOnly(t *testing.T) { PreCheck: func() { testAccPreCheck(t) }, ErrorCheck: testAccErrorCheck(t, cloudcontrolapi.EndpointsID), ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, + CheckDestroy: testAccCheckAwsCloudControlApiResourceDestroy, Steps: []resource.TestStep{ { - Config: testAccAwsCloudformationResourceConfigDesiredStateCreateOnly(rName1), + Config: testAccAwsCloudControlApiResourceConfigDesiredStateCreateOnly(rName1), Check: resource.ComposeAggregateTestCheckFunc( - resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"LogGroupName":"`+rName1+`"`)), + resource.TestMatchResourceAttr(resourceName, "properties", regexp.MustCompile(`"LogGroupName":"`+rName1+`"`)), ), }, { - Config: testAccAwsCloudformationResourceConfigDesiredStateCreateOnly(rName2), + Config: testAccAwsCloudControlApiResourceConfigDesiredStateCreateOnly(rName2), Check: resource.ComposeAggregateTestCheckFunc( - resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"LogGroupName":"`+rName2+`"`)), + resource.TestMatchResourceAttr(resourceName, "properties", regexp.MustCompile(`"LogGroupName":"`+rName2+`"`)), ), }, }, }) } -func TestAccAwsCloudformationResource_DesiredState_IntegerValueAdded(t *testing.T) { +func TestAccAwsCloudControlApiResource_DesiredState_IntegerValueAdded(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_cloudformation_resource.test" @@ -168,25 +169,25 @@ func TestAccAwsCloudformationResource_DesiredState_IntegerValueAdded(t *testing. PreCheck: func() { testAccPreCheck(t) }, ErrorCheck: testAccErrorCheck(t, cloudcontrolapi.EndpointsID), ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, + CheckDestroy: testAccCheckAwsCloudControlApiResourceDestroy, Steps: []resource.TestStep{ { - Config: testAccAwsCloudformationResourceConfigDesiredStateIntegerValueRemoved(rName), + Config: testAccAwsCloudControlApiResourceConfigDesiredStateIntegerValueRemoved(rName), Check: resource.ComposeAggregateTestCheckFunc( - resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"LogGroupName":`)), + resource.TestMatchResourceAttr(resourceName, "properties", regexp.MustCompile(`"LogGroupName":`)), ), }, { - Config: testAccAwsCloudformationResourceConfigDesiredStateIntegerValue(rName, 14), + Config: testAccAwsCloudControlApiResourceConfigDesiredStateIntegerValue(rName, 14), Check: resource.ComposeAggregateTestCheckFunc( - resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"RetentionInDays":14`)), + resource.TestMatchResourceAttr(resourceName, "properties", regexp.MustCompile(`"RetentionInDays":14`)), ), }, }, }) } -func TestAccAwsCloudformationResource_DesiredState_IntegerValueRemoved(t *testing.T) { +func TestAccAwsCloudControlApiResource_DesiredState_IntegerValueRemoved(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_cloudformation_resource.test" @@ -194,25 +195,25 @@ func TestAccAwsCloudformationResource_DesiredState_IntegerValueRemoved(t *testin PreCheck: func() { testAccPreCheck(t) }, ErrorCheck: testAccErrorCheck(t, cloudcontrolapi.EndpointsID), ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, + CheckDestroy: testAccCheckAwsCloudControlApiResourceDestroy, Steps: []resource.TestStep{ { - Config: testAccAwsCloudformationResourceConfigDesiredStateIntegerValue(rName, 14), + Config: testAccAwsCloudControlApiResourceConfigDesiredStateIntegerValue(rName, 14), Check: resource.ComposeAggregateTestCheckFunc( - resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"RetentionInDays":14`)), + resource.TestMatchResourceAttr(resourceName, "properties", regexp.MustCompile(`"RetentionInDays":14`)), ), }, { - Config: testAccAwsCloudformationResourceConfigDesiredStateIntegerValueRemoved(rName), + Config: testAccAwsCloudControlApiResourceConfigDesiredStateIntegerValueRemoved(rName), Check: resource.ComposeAggregateTestCheckFunc( - resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"LogGroupName":`)), + resource.TestMatchResourceAttr(resourceName, "properties", regexp.MustCompile(`"LogGroupName":`)), ), }, }, }) } -func TestAccAwsCloudformationResource_DesiredState_IntegerValueUpdate(t *testing.T) { +func TestAccAwsCloudControlApiResource_DesiredState_IntegerValueUpdate(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_cloudformation_resource.test" @@ -220,59 +221,59 @@ func TestAccAwsCloudformationResource_DesiredState_IntegerValueUpdate(t *testing PreCheck: func() { testAccPreCheck(t) }, ErrorCheck: testAccErrorCheck(t, cloudcontrolapi.EndpointsID), ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, + CheckDestroy: testAccCheckAwsCloudControlApiResourceDestroy, Steps: []resource.TestStep{ { - Config: testAccAwsCloudformationResourceConfigDesiredStateIntegerValue(rName, 7), + Config: testAccAwsCloudControlApiResourceConfigDesiredStateIntegerValue(rName, 7), Check: resource.ComposeAggregateTestCheckFunc( - resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"RetentionInDays":7`)), + resource.TestMatchResourceAttr(resourceName, "properties", regexp.MustCompile(`"RetentionInDays":7`)), ), }, { - Config: testAccAwsCloudformationResourceConfigDesiredStateIntegerValue(rName, 14), + Config: testAccAwsCloudControlApiResourceConfigDesiredStateIntegerValue(rName, 14), Check: resource.ComposeAggregateTestCheckFunc( - resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"RetentionInDays":14`)), + resource.TestMatchResourceAttr(resourceName, "properties", regexp.MustCompile(`"RetentionInDays":14`)), ), }, }, }) } -func TestAccAwsCloudformationResource_DesiredState_InvalidPropertyName(t *testing.T) { +func TestAccAwsCloudControlApiResource_DesiredState_InvalidPropertyName(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ErrorCheck: testAccErrorCheck(t, cloudcontrolapi.EndpointsID), ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, + CheckDestroy: testAccCheckAwsCloudControlApiResourceDestroy, Steps: []resource.TestStep{ { - Config: testAccAwsCloudformationResourceConfigDesiredStateInvalidPropertyName(rName), + Config: testAccAwsCloudControlApiResourceConfigDesiredStateInvalidPropertyName(rName), ExpectError: regexp.MustCompile(`\(root\): Additional property InvalidName is not allowed`), }, }, }) } -func TestAccAwsCloudformationResource_DesiredState_InvalidPropertyValue(t *testing.T) { +func TestAccAwsCloudControlApiResource_DesiredState_InvalidPropertyValue(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ErrorCheck: testAccErrorCheck(t, cloudcontrolapi.EndpointsID), ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, + CheckDestroy: testAccCheckAwsCloudControlApiResourceDestroy, Steps: []resource.TestStep{ { - Config: testAccAwsCloudformationResourceConfigDesiredStateInvalidPropertyValue(rName), + Config: testAccAwsCloudControlApiResourceConfigDesiredStateInvalidPropertyValue(rName), ExpectError: regexp.MustCompile(`LogGroupName: Does not match pattern`), }, }, }) } -func TestAccAwsCloudformationResource_DesiredState_ObjectValueAdded(t *testing.T) { +func TestAccAwsCloudControlApiResource_DesiredState_ObjectValueAdded(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_cloudformation_resource.test" @@ -280,25 +281,25 @@ func TestAccAwsCloudformationResource_DesiredState_ObjectValueAdded(t *testing.T PreCheck: func() { testAccPreCheck(t) }, ErrorCheck: testAccErrorCheck(t, cloudcontrolapi.EndpointsID), ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, + CheckDestroy: testAccCheckAwsCloudControlApiResourceDestroy, Steps: []resource.TestStep{ { - Config: testAccAwsCloudformationResourceConfigDesiredStateObjectValueRemoved(rName), + Config: testAccAwsCloudControlApiResourceConfigDesiredStateObjectValueRemoved(rName), Check: resource.ComposeAggregateTestCheckFunc( - resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"Name":`)), + resource.TestMatchResourceAttr(resourceName, "properties", regexp.MustCompile(`"Name":`)), ), }, { - Config: testAccAwsCloudformationResourceConfigDesiredStateObjectValue1(rName, "key1", "value1"), + Config: testAccAwsCloudControlApiResourceConfigDesiredStateObjectValue1(rName, "key1", "value1"), Check: resource.ComposeAggregateTestCheckFunc( - resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"Value":"value1"`)), + resource.TestMatchResourceAttr(resourceName, "properties", regexp.MustCompile(`"Value":"value1"`)), ), }, }, }) } -func TestAccAwsCloudformationResource_DesiredState_ObjectValueRemoved(t *testing.T) { +func TestAccAwsCloudControlApiResource_DesiredState_ObjectValueRemoved(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_cloudformation_resource.test" @@ -306,25 +307,25 @@ func TestAccAwsCloudformationResource_DesiredState_ObjectValueRemoved(t *testing PreCheck: func() { testAccPreCheck(t) }, ErrorCheck: testAccErrorCheck(t, cloudcontrolapi.EndpointsID), ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, + CheckDestroy: testAccCheckAwsCloudControlApiResourceDestroy, Steps: []resource.TestStep{ { - Config: testAccAwsCloudformationResourceConfigDesiredStateObjectValue1(rName, "key1", "value1"), + Config: testAccAwsCloudControlApiResourceConfigDesiredStateObjectValue1(rName, "key1", "value1"), Check: resource.ComposeAggregateTestCheckFunc( - resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"Value":"value1"`)), + resource.TestMatchResourceAttr(resourceName, "properties", regexp.MustCompile(`"Value":"value1"`)), ), }, { - Config: testAccAwsCloudformationResourceConfigDesiredStateObjectValueRemoved(rName), + Config: testAccAwsCloudControlApiResourceConfigDesiredStateObjectValueRemoved(rName), Check: resource.ComposeAggregateTestCheckFunc( - resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"Name":`)), + resource.TestMatchResourceAttr(resourceName, "properties", regexp.MustCompile(`"Name":`)), ), }, }, }) } -func TestAccAwsCloudformationResource_DesiredState_ObjectValueUpdate(t *testing.T) { +func TestAccAwsCloudControlApiResource_DesiredState_ObjectValueUpdate(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_cloudformation_resource.test" @@ -332,31 +333,31 @@ func TestAccAwsCloudformationResource_DesiredState_ObjectValueUpdate(t *testing. PreCheck: func() { testAccPreCheck(t) }, ErrorCheck: testAccErrorCheck(t, cloudcontrolapi.EndpointsID), ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, + CheckDestroy: testAccCheckAwsCloudControlApiResourceDestroy, Steps: []resource.TestStep{ { - Config: testAccAwsCloudformationResourceConfigDesiredStateObjectValue1(rName, "key1", "value1"), + Config: testAccAwsCloudControlApiResourceConfigDesiredStateObjectValue1(rName, "key1", "value1"), Check: resource.ComposeAggregateTestCheckFunc( - resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"Value":"value1"`)), + resource.TestMatchResourceAttr(resourceName, "properties", regexp.MustCompile(`"Value":"value1"`)), ), }, { - Config: testAccAwsCloudformationResourceConfigDesiredStateObjectValue1(rName, "key1", "value1updated"), + Config: testAccAwsCloudControlApiResourceConfigDesiredStateObjectValue1(rName, "key1", "value1updated"), Check: resource.ComposeAggregateTestCheckFunc( - resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"Value":"value1updated"`)), + resource.TestMatchResourceAttr(resourceName, "properties", regexp.MustCompile(`"Value":"value1updated"`)), ), }, { - Config: testAccAwsCloudformationResourceConfigDesiredStateObjectValue1(rName, "key2", "value2"), + Config: testAccAwsCloudControlApiResourceConfigDesiredStateObjectValue1(rName, "key2", "value2"), Check: resource.ComposeAggregateTestCheckFunc( - resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"Value":"value2"`)), + resource.TestMatchResourceAttr(resourceName, "properties", regexp.MustCompile(`"Value":"value2"`)), ), }, }, }) } -func TestAccAwsCloudformationResource_DesiredState_StringValueAdded(t *testing.T) { +func TestAccAwsCloudControlApiResource_DesiredState_StringValueAdded(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_cloudformation_resource.test" @@ -364,25 +365,25 @@ func TestAccAwsCloudformationResource_DesiredState_StringValueAdded(t *testing.T PreCheck: func() { testAccPreCheck(t) }, ErrorCheck: testAccErrorCheck(t, cloudcontrolapi.EndpointsID), ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, + CheckDestroy: testAccCheckAwsCloudControlApiResourceDestroy, Steps: []resource.TestStep{ { - Config: testAccAwsCloudformationResourceConfigDesiredStateStringValueRemoved(rName), + Config: testAccAwsCloudControlApiResourceConfigDesiredStateStringValueRemoved(rName), Check: resource.ComposeAggregateTestCheckFunc( - resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"Name":`)), + resource.TestMatchResourceAttr(resourceName, "properties", regexp.MustCompile(`"Name":`)), ), }, { - Config: testAccAwsCloudformationResourceConfigDesiredStateStringValue(rName, "description1"), + Config: testAccAwsCloudControlApiResourceConfigDesiredStateStringValue(rName, "description1"), Check: resource.ComposeAggregateTestCheckFunc( - resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"Description":"description1"`)), + resource.TestMatchResourceAttr(resourceName, "properties", regexp.MustCompile(`"Description":"description1"`)), ), }, }, }) } -func TestAccAwsCloudformationResource_DesiredState_StringValueRemoved(t *testing.T) { +func TestAccAwsCloudControlApiResource_DesiredState_StringValueRemoved(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_cloudformation_resource.test" @@ -390,25 +391,25 @@ func TestAccAwsCloudformationResource_DesiredState_StringValueRemoved(t *testing PreCheck: func() { testAccPreCheck(t) }, ErrorCheck: testAccErrorCheck(t, cloudcontrolapi.EndpointsID), ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, + CheckDestroy: testAccCheckAwsCloudControlApiResourceDestroy, Steps: []resource.TestStep{ { - Config: testAccAwsCloudformationResourceConfigDesiredStateStringValue(rName, "description1"), + Config: testAccAwsCloudControlApiResourceConfigDesiredStateStringValue(rName, "description1"), Check: resource.ComposeAggregateTestCheckFunc( - resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"Description":"description1"`)), + resource.TestMatchResourceAttr(resourceName, "properties", regexp.MustCompile(`"Description":"description1"`)), ), }, { - Config: testAccAwsCloudformationResourceConfigDesiredStateStringValueRemoved(rName), + Config: testAccAwsCloudControlApiResourceConfigDesiredStateStringValueRemoved(rName), Check: resource.ComposeAggregateTestCheckFunc( - resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"Name":`)), + resource.TestMatchResourceAttr(resourceName, "properties", regexp.MustCompile(`"Name":`)), ), }, }, }) } -func TestAccAwsCloudformationResource_DesiredState_StringValueUpdate(t *testing.T) { +func TestAccAwsCloudControlApiResource_DesiredState_StringValueUpdate(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_cloudformation_resource.test" @@ -416,36 +417,36 @@ func TestAccAwsCloudformationResource_DesiredState_StringValueUpdate(t *testing. PreCheck: func() { testAccPreCheck(t) }, ErrorCheck: testAccErrorCheck(t, cloudcontrolapi.EndpointsID), ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, + CheckDestroy: testAccCheckAwsCloudControlApiResourceDestroy, Steps: []resource.TestStep{ { - Config: testAccAwsCloudformationResourceConfigDesiredStateStringValue(rName, "description1"), + Config: testAccAwsCloudControlApiResourceConfigDesiredStateStringValue(rName, "description1"), Check: resource.ComposeAggregateTestCheckFunc( - resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"Description":"description1"`)), + resource.TestMatchResourceAttr(resourceName, "properties", regexp.MustCompile(`"Description":"description1"`)), ), }, { - Config: testAccAwsCloudformationResourceConfigDesiredStateStringValue(rName, "description2"), + Config: testAccAwsCloudControlApiResourceConfigDesiredStateStringValue(rName, "description2"), Check: resource.ComposeAggregateTestCheckFunc( - resource.TestMatchResourceAttr(resourceName, "resource_model", regexp.MustCompile(`"Description":"description2"`)), + resource.TestMatchResourceAttr(resourceName, "properties", regexp.MustCompile(`"Description":"description2"`)), ), }, }, }) } -func TestAccAwsCloudformationResource_ResourceSchema(t *testing.T) { +func TestAccAwsCloudControlApiResource_ResourceSchema(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_cloudformation_resource.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, cloudcontrolapi.EndpointsID), + ErrorCheck: testAccErrorCheck(t, cloudcontrolapi.EndpointsID, cloudformation.EndpointsID), ProviderFactories: testAccProviderFactories, - CheckDestroy: testAccCheckAwsCloudformationResourceDestroy, + CheckDestroy: testAccCheckAwsCloudControlApiResourceDestroy, Steps: []resource.TestStep{ { - Config: testAccAwsCloudformationResourceConfigResourceSchema(rName), + Config: testAccAwsCloudControlApiResourceConfigResourceSchema(rName), Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttrPair(resourceName, "schema", "data.aws_cloudformation_type.test", "schema"), ), @@ -454,7 +455,7 @@ func TestAccAwsCloudformationResource_ResourceSchema(t *testing.T) { }) } -func testAccCheckAwsCloudformationResourceDestroy(s *terraform.State) error { +func testAccCheckAwsCloudControlApiResourceDestroy(s *terraform.State) error { conn := testAccProvider.Meta().(*AWSClient).cloudcontrolapiconn for _, rs := range s.RootModule().Resources { @@ -489,7 +490,7 @@ func testAccCheckAwsCloudformationResourceDestroy(s *terraform.State) error { return nil } -func testAccAwsCloudformationResourceConfig(rName string) string { +func testAccAwsCloudControlApiResourceConfig(rName string) string { return fmt.Sprintf(` resource "aws_cloudformation_resource" "test" { type_name = "AWS::Logs::LogGroup" @@ -501,7 +502,7 @@ resource "aws_cloudformation_resource" "test" { `, rName) } -func testAccAwsCloudformationResourceConfigDesiredStateBooleanValue(rName string, booleanValue bool) string { +func testAccAwsCloudControlApiResourceConfigDesiredStateBooleanValue(rName string, booleanValue bool) string { return fmt.Sprintf(` resource "aws_cloudformation_resource" "test" { type_name = "AWS::ApiGateway::ApiKey" @@ -515,7 +516,7 @@ resource "aws_cloudformation_resource" "test" { `, rName, booleanValue) } -func testAccAwsCloudformationResourceConfigDesiredStateBooleanValueRemoved(rName string) string { +func testAccAwsCloudControlApiResourceConfigDesiredStateBooleanValueRemoved(rName string) string { return fmt.Sprintf(` resource "aws_cloudformation_resource" "test" { type_name = "AWS::ApiGateway::ApiKey" @@ -528,7 +529,7 @@ resource "aws_cloudformation_resource" "test" { `, rName) } -func testAccAwsCloudformationResourceConfigDesiredStateCreateOnly(rName string) string { +func testAccAwsCloudControlApiResourceConfigDesiredStateCreateOnly(rName string) string { return fmt.Sprintf(` resource "aws_cloudformation_resource" "test" { type_name = "AWS::Logs::LogGroup" @@ -540,7 +541,7 @@ resource "aws_cloudformation_resource" "test" { `, rName) } -func testAccAwsCloudformationResourceConfigDesiredStateIntegerValue(rName string, integerValue int) string { +func testAccAwsCloudControlApiResourceConfigDesiredStateIntegerValue(rName string, integerValue int) string { return fmt.Sprintf(` resource "aws_cloudformation_resource" "test" { type_name = "AWS::Logs::LogGroup" @@ -553,7 +554,7 @@ resource "aws_cloudformation_resource" "test" { `, rName, integerValue) } -func testAccAwsCloudformationResourceConfigDesiredStateIntegerValueRemoved(rName string) string { +func testAccAwsCloudControlApiResourceConfigDesiredStateIntegerValueRemoved(rName string) string { return fmt.Sprintf(` resource "aws_cloudformation_resource" "test" { type_name = "AWS::Logs::LogGroup" @@ -565,7 +566,7 @@ resource "aws_cloudformation_resource" "test" { `, rName) } -func testAccAwsCloudformationResourceConfigDesiredStateInvalidPropertyName(rName string) string { +func testAccAwsCloudControlApiResourceConfigDesiredStateInvalidPropertyName(rName string) string { return fmt.Sprintf(` resource "aws_cloudformation_resource" "test" { type_name = "AWS::Logs::LogGroup" @@ -577,7 +578,7 @@ resource "aws_cloudformation_resource" "test" { `, rName) } -func testAccAwsCloudformationResourceConfigDesiredStateInvalidPropertyValue(rName string) string { +func testAccAwsCloudControlApiResourceConfigDesiredStateInvalidPropertyValue(rName string) string { return fmt.Sprintf(` resource "aws_cloudformation_resource" "test" { type_name = "AWS::Logs::LogGroup" @@ -589,7 +590,7 @@ resource "aws_cloudformation_resource" "test" { `, rName) } -func testAccAwsCloudformationResourceConfigDesiredStateObjectValue1(rName string, key1 string, value1 string) string { +func testAccAwsCloudControlApiResourceConfigDesiredStateObjectValue1(rName string, key1 string, value1 string) string { return fmt.Sprintf(` resource "aws_cloudformation_resource" "test" { type_name = "AWS::ECS::Cluster" @@ -607,7 +608,7 @@ resource "aws_cloudformation_resource" "test" { `, rName, key1, value1) } -func testAccAwsCloudformationResourceConfigDesiredStateObjectValueRemoved(rName string) string { +func testAccAwsCloudControlApiResourceConfigDesiredStateObjectValueRemoved(rName string) string { return fmt.Sprintf(` resource "aws_cloudformation_resource" "test" { type_name = "AWS::ECS::Cluster" @@ -619,7 +620,7 @@ resource "aws_cloudformation_resource" "test" { `, rName) } -func testAccAwsCloudformationResourceConfigDesiredStateStringValue(rName string, stringValue string) string { +func testAccAwsCloudControlApiResourceConfigDesiredStateStringValue(rName string, stringValue string) string { return fmt.Sprintf(` resource "aws_cloudformation_resource" "test" { type_name = "AWS::Athena::WorkGroup" @@ -632,7 +633,7 @@ resource "aws_cloudformation_resource" "test" { `, rName, stringValue) } -func testAccAwsCloudformationResourceConfigDesiredStateStringValueRemoved(rName string) string { +func testAccAwsCloudControlApiResourceConfigDesiredStateStringValueRemoved(rName string) string { return fmt.Sprintf(` resource "aws_cloudformation_resource" "test" { type_name = "AWS::Athena::WorkGroup" @@ -644,7 +645,7 @@ resource "aws_cloudformation_resource" "test" { `, rName) } -func testAccAwsCloudformationResourceConfigResourceSchema(rName string) string { +func testAccAwsCloudControlApiResourceConfigResourceSchema(rName string) string { return fmt.Sprintf(` data "aws_cloudformation_type" "test" { type = "RESOURCE" From cbe77bceeee9b01f1fc5d993ad60902e07561976 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 16 Sep 2021 08:33:54 -0400 Subject: [PATCH 18/33] Rename resources 'aws_cloudformation_resource' -> 'aws_cloudcontrolapi_resource'. --- ...ource_aws_cloudcontrolapi_resource_test.go | 12 ++-- ...ource_aws_cloudcontrolapi_resource_test.go | 60 +++++++++---------- .../d/cloudcontrolapi_resource.html.markdown | 14 ++--- .../r/cloudcontrolapi_resource.html.markdown | 14 ++--- 4 files changed, 50 insertions(+), 50 deletions(-) diff --git a/aws/data_source_aws_cloudcontrolapi_resource_test.go b/aws/data_source_aws_cloudcontrolapi_resource_test.go index 44daefb4504..152309a0165 100644 --- a/aws/data_source_aws_cloudcontrolapi_resource_test.go +++ b/aws/data_source_aws_cloudcontrolapi_resource_test.go @@ -11,8 +11,8 @@ import ( func TestAccAwsCloudControlApiResourceDataSource_basic(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") - dataSourceName := "data.aws_cloudformation_resource.test" - resourceName := "aws_cloudformation_resource.test" + dataSourceName := "data.aws_cloudcontrolapi_resource.test" + resourceName := "aws_cloudcontrolapi_resource.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -34,7 +34,7 @@ func TestAccAwsCloudControlApiResourceDataSource_basic(t *testing.T) { func testAccAwsCloudControlApiResourceDataSourceConfig(rName string) string { return fmt.Sprintf(` -resource "aws_cloudformation_resource" "test" { +resource "aws_cloudcontrolapi_resource" "test" { type_name = "AWS::Logs::LogGroup" desired_state = jsonencode({ @@ -42,9 +42,9 @@ resource "aws_cloudformation_resource" "test" { }) } -data "aws_cloudformation_resource" "test" { - identifier = aws_cloudformation_resource.test.id - type_name = aws_cloudformation_resource.test.type_name +data "aws_cloudcontrolapi_resource" "test" { + identifier = aws_cloudcontrolapi_resource.test.id + type_name = aws_cloudcontrolapi_resource.test.type_name } `, rName) } diff --git a/aws/resource_aws_cloudcontrolapi_resource_test.go b/aws/resource_aws_cloudcontrolapi_resource_test.go index 980541a564a..2446164f0c2 100644 --- a/aws/resource_aws_cloudcontrolapi_resource_test.go +++ b/aws/resource_aws_cloudcontrolapi_resource_test.go @@ -16,7 +16,7 @@ import ( func TestAccAwsCloudControlApiResource_basic(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") - resourceName := "aws_cloudformation_resource.test" + resourceName := "aws_cloudcontrolapi_resource.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -37,7 +37,7 @@ func TestAccAwsCloudControlApiResource_basic(t *testing.T) { func TestAccAwsCloudControlApiResource_disappears(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") - resourceName := "aws_cloudformation_resource.test" + resourceName := "aws_cloudcontrolapi_resource.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -58,7 +58,7 @@ func TestAccAwsCloudControlApiResource_disappears(t *testing.T) { func TestAccAwsCloudControlApiResource_DesiredState_BooleanValueAdded(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") - resourceName := "aws_cloudformation_resource.test" + resourceName := "aws_cloudcontrolapi_resource.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -84,7 +84,7 @@ func TestAccAwsCloudControlApiResource_DesiredState_BooleanValueAdded(t *testing func TestAccAwsCloudControlApiResource_DesiredState_BooleanValueRemoved(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") - resourceName := "aws_cloudformation_resource.test" + resourceName := "aws_cloudcontrolapi_resource.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -110,7 +110,7 @@ func TestAccAwsCloudControlApiResource_DesiredState_BooleanValueRemoved(t *testi func TestAccAwsCloudControlApiResource_DesiredState_BooleanValueUpdate(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") - resourceName := "aws_cloudformation_resource.test" + resourceName := "aws_cloudcontrolapi_resource.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -137,7 +137,7 @@ func TestAccAwsCloudControlApiResource_DesiredState_BooleanValueUpdate(t *testin func TestAccAwsCloudControlApiResource_DesiredState_CreateOnly(t *testing.T) { rName1 := acctest.RandomWithPrefix("tf-acc-test") rName2 := acctest.RandomWithPrefix("tf-acc-test") - resourceName := "aws_cloudformation_resource.test" + resourceName := "aws_cloudcontrolapi_resource.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -163,7 +163,7 @@ func TestAccAwsCloudControlApiResource_DesiredState_CreateOnly(t *testing.T) { func TestAccAwsCloudControlApiResource_DesiredState_IntegerValueAdded(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") - resourceName := "aws_cloudformation_resource.test" + resourceName := "aws_cloudcontrolapi_resource.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -189,7 +189,7 @@ func TestAccAwsCloudControlApiResource_DesiredState_IntegerValueAdded(t *testing func TestAccAwsCloudControlApiResource_DesiredState_IntegerValueRemoved(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") - resourceName := "aws_cloudformation_resource.test" + resourceName := "aws_cloudcontrolapi_resource.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -215,7 +215,7 @@ func TestAccAwsCloudControlApiResource_DesiredState_IntegerValueRemoved(t *testi func TestAccAwsCloudControlApiResource_DesiredState_IntegerValueUpdate(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") - resourceName := "aws_cloudformation_resource.test" + resourceName := "aws_cloudcontrolapi_resource.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -275,7 +275,7 @@ func TestAccAwsCloudControlApiResource_DesiredState_InvalidPropertyValue(t *test func TestAccAwsCloudControlApiResource_DesiredState_ObjectValueAdded(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") - resourceName := "aws_cloudformation_resource.test" + resourceName := "aws_cloudcontrolapi_resource.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -301,7 +301,7 @@ func TestAccAwsCloudControlApiResource_DesiredState_ObjectValueAdded(t *testing. func TestAccAwsCloudControlApiResource_DesiredState_ObjectValueRemoved(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") - resourceName := "aws_cloudformation_resource.test" + resourceName := "aws_cloudcontrolapi_resource.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -327,7 +327,7 @@ func TestAccAwsCloudControlApiResource_DesiredState_ObjectValueRemoved(t *testin func TestAccAwsCloudControlApiResource_DesiredState_ObjectValueUpdate(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") - resourceName := "aws_cloudformation_resource.test" + resourceName := "aws_cloudcontrolapi_resource.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -359,7 +359,7 @@ func TestAccAwsCloudControlApiResource_DesiredState_ObjectValueUpdate(t *testing func TestAccAwsCloudControlApiResource_DesiredState_StringValueAdded(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") - resourceName := "aws_cloudformation_resource.test" + resourceName := "aws_cloudcontrolapi_resource.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -385,7 +385,7 @@ func TestAccAwsCloudControlApiResource_DesiredState_StringValueAdded(t *testing. func TestAccAwsCloudControlApiResource_DesiredState_StringValueRemoved(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") - resourceName := "aws_cloudformation_resource.test" + resourceName := "aws_cloudcontrolapi_resource.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -411,7 +411,7 @@ func TestAccAwsCloudControlApiResource_DesiredState_StringValueRemoved(t *testin func TestAccAwsCloudControlApiResource_DesiredState_StringValueUpdate(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") - resourceName := "aws_cloudformation_resource.test" + resourceName := "aws_cloudcontrolapi_resource.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -437,7 +437,7 @@ func TestAccAwsCloudControlApiResource_DesiredState_StringValueUpdate(t *testing func TestAccAwsCloudControlApiResource_ResourceSchema(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") - resourceName := "aws_cloudformation_resource.test" + resourceName := "aws_cloudcontrolapi_resource.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -459,7 +459,7 @@ func testAccCheckAwsCloudControlApiResourceDestroy(s *terraform.State) error { conn := testAccProvider.Meta().(*AWSClient).cloudcontrolapiconn for _, rs := range s.RootModule().Resources { - if rs.Type != "aws_cloudformation_resource" { + if rs.Type != "aws_cloudcontrolapi_resource" { continue } @@ -492,7 +492,7 @@ func testAccCheckAwsCloudControlApiResourceDestroy(s *terraform.State) error { func testAccAwsCloudControlApiResourceConfig(rName string) string { return fmt.Sprintf(` -resource "aws_cloudformation_resource" "test" { +resource "aws_cloudcontrolapi_resource" "test" { type_name = "AWS::Logs::LogGroup" desired_state = jsonencode({ @@ -504,7 +504,7 @@ resource "aws_cloudformation_resource" "test" { func testAccAwsCloudControlApiResourceConfigDesiredStateBooleanValue(rName string, booleanValue bool) string { return fmt.Sprintf(` -resource "aws_cloudformation_resource" "test" { +resource "aws_cloudcontrolapi_resource" "test" { type_name = "AWS::ApiGateway::ApiKey" desired_state = jsonencode({ @@ -518,7 +518,7 @@ resource "aws_cloudformation_resource" "test" { func testAccAwsCloudControlApiResourceConfigDesiredStateBooleanValueRemoved(rName string) string { return fmt.Sprintf(` -resource "aws_cloudformation_resource" "test" { +resource "aws_cloudcontrolapi_resource" "test" { type_name = "AWS::ApiGateway::ApiKey" desired_state = jsonencode({ @@ -531,7 +531,7 @@ resource "aws_cloudformation_resource" "test" { func testAccAwsCloudControlApiResourceConfigDesiredStateCreateOnly(rName string) string { return fmt.Sprintf(` -resource "aws_cloudformation_resource" "test" { +resource "aws_cloudcontrolapi_resource" "test" { type_name = "AWS::Logs::LogGroup" desired_state = jsonencode({ @@ -543,7 +543,7 @@ resource "aws_cloudformation_resource" "test" { func testAccAwsCloudControlApiResourceConfigDesiredStateIntegerValue(rName string, integerValue int) string { return fmt.Sprintf(` -resource "aws_cloudformation_resource" "test" { +resource "aws_cloudcontrolapi_resource" "test" { type_name = "AWS::Logs::LogGroup" desired_state = jsonencode({ @@ -556,7 +556,7 @@ resource "aws_cloudformation_resource" "test" { func testAccAwsCloudControlApiResourceConfigDesiredStateIntegerValueRemoved(rName string) string { return fmt.Sprintf(` -resource "aws_cloudformation_resource" "test" { +resource "aws_cloudcontrolapi_resource" "test" { type_name = "AWS::Logs::LogGroup" desired_state = jsonencode({ @@ -568,7 +568,7 @@ resource "aws_cloudformation_resource" "test" { func testAccAwsCloudControlApiResourceConfigDesiredStateInvalidPropertyName(rName string) string { return fmt.Sprintf(` -resource "aws_cloudformation_resource" "test" { +resource "aws_cloudcontrolapi_resource" "test" { type_name = "AWS::Logs::LogGroup" desired_state = jsonencode({ @@ -580,7 +580,7 @@ resource "aws_cloudformation_resource" "test" { func testAccAwsCloudControlApiResourceConfigDesiredStateInvalidPropertyValue(rName string) string { return fmt.Sprintf(` -resource "aws_cloudformation_resource" "test" { +resource "aws_cloudcontrolapi_resource" "test" { type_name = "AWS::Logs::LogGroup" desired_state = jsonencode({ @@ -592,7 +592,7 @@ resource "aws_cloudformation_resource" "test" { func testAccAwsCloudControlApiResourceConfigDesiredStateObjectValue1(rName string, key1 string, value1 string) string { return fmt.Sprintf(` -resource "aws_cloudformation_resource" "test" { +resource "aws_cloudcontrolapi_resource" "test" { type_name = "AWS::ECS::Cluster" desired_state = jsonencode({ @@ -610,7 +610,7 @@ resource "aws_cloudformation_resource" "test" { func testAccAwsCloudControlApiResourceConfigDesiredStateObjectValueRemoved(rName string) string { return fmt.Sprintf(` -resource "aws_cloudformation_resource" "test" { +resource "aws_cloudcontrolapi_resource" "test" { type_name = "AWS::ECS::Cluster" desired_state = jsonencode({ @@ -622,7 +622,7 @@ resource "aws_cloudformation_resource" "test" { func testAccAwsCloudControlApiResourceConfigDesiredStateStringValue(rName string, stringValue string) string { return fmt.Sprintf(` -resource "aws_cloudformation_resource" "test" { +resource "aws_cloudcontrolapi_resource" "test" { type_name = "AWS::Athena::WorkGroup" desired_state = jsonencode({ @@ -635,7 +635,7 @@ resource "aws_cloudformation_resource" "test" { func testAccAwsCloudControlApiResourceConfigDesiredStateStringValueRemoved(rName string) string { return fmt.Sprintf(` -resource "aws_cloudformation_resource" "test" { +resource "aws_cloudcontrolapi_resource" "test" { type_name = "AWS::Athena::WorkGroup" desired_state = jsonencode({ @@ -652,7 +652,7 @@ data "aws_cloudformation_type" "test" { type_name = "AWS::Logs::LogGroup" } -resource "aws_cloudformation_resource" "test" { +resource "aws_cloudcontrolapi_resource" "test" { schema = data.aws_cloudformation_type.test.schema type_name = data.aws_cloudformation_type.test.type_name diff --git a/website/docs/d/cloudcontrolapi_resource.html.markdown b/website/docs/d/cloudcontrolapi_resource.html.markdown index 8ac6e2b4509..72c6d6d4746 100644 --- a/website/docs/d/cloudcontrolapi_resource.html.markdown +++ b/website/docs/d/cloudcontrolapi_resource.html.markdown @@ -1,19 +1,19 @@ --- -subcategory: "CloudFormation" +subcategory: "Cloud Control API" layout: "aws" -page_title: "AWS: aws_cloudformation_resource" +page_title: "AWS: aws_cloudcontrolapi_resource" description: |- - Provides details for a CloudFormation Resource. + Provides details for a Cloud Control API Resource. --- -# Data Source: aws_cloudformation_resource +# Data Source: aws_cloudcontrolapi_resource -Provides details for a CloudFormation Resource. The reading of these resources is proxied through CloudFormation handlers to the backend service. +Provides details for a Cloud Control API Resource. The reading of these resources is proxied through Cloud Control API handlers to the backend service. ## Example Usage ```terraform -data "aws_cloudformation_resource" "example" { +data "aws_cloudcontrolapi_resource" "example" { identifier = "example" type_name = "AWS::ECS::Cluster" } @@ -35,4 +35,4 @@ The following arguments are optional: In addition to all arguments above, the following attributes are exported: -* `properties` - JSON string matching the CloudFormation resource type schema with current configuration. Underlying attributes can be referenced via the [`jsondecode()` function](https://www.terraform.io/docs/language/functions/jsondecode.html), for example, `jsondecode(data.aws_cloudformation_resource.example.properties)["example"]`. +* `properties` - JSON string matching the CloudFormation resource type schema with current configuration. Underlying attributes can be referenced via the [`jsondecode()` function](https://www.terraform.io/docs/language/functions/jsondecode.html), for example, `jsondecode(data.aws_cloudcontrolapi_resource.example.properties)["example"]`. diff --git a/website/docs/r/cloudcontrolapi_resource.html.markdown b/website/docs/r/cloudcontrolapi_resource.html.markdown index afcf4cccffa..75636c677e4 100644 --- a/website/docs/r/cloudcontrolapi_resource.html.markdown +++ b/website/docs/r/cloudcontrolapi_resource.html.markdown @@ -1,19 +1,19 @@ --- -subcategory: "CloudFormation" +subcategory: "Cloud Control API" layout: "aws" -page_title: "AWS: aws_cloudformation_resource" +page_title: "AWS: aws_cloudcontrolapi_resource" description: |- - Manages a CloudFormation Resource. + Manages a Cloud Control API Resource. --- -# Resource: aws_cloudformation_resource +# Resource: aws_cloudcontrolapi_resource -Manages a CloudFormation Resource. The configuration and lifecycle handling of these resources is proxied through CloudFormation handlers to the backend service. +Manages a Cloud Control API Resource. The configuration and lifecycle handling of these resources is proxied through Cloud Control API handlers to the backend service. ## Example Usage ```terraform -resource "aws_cloudformation_resource" "example" { +resource "aws_cloudcontrolapi_resource" "example" { type_name = "AWS::ECS::Cluster" desired_state = jsonencode({ @@ -45,4 +45,4 @@ The following arguments are optional: In addition to all arguments above, the following attributes are exported: -* `properties` - JSON string matching the CloudFormation resource type schema with current configuration. Underlying attributes can be referenced via the [`jsondecode()` function](https://www.terraform.io/docs/language/functions/jsondecode.html), for example, `jsondecode(data.aws_cloudformation_resource.example.properties)["example"]`. +* `properties` - JSON string matching the CloudFormation resource type schema with current configuration. Underlying attributes can be referenced via the [`jsondecode()` function](https://www.terraform.io/docs/language/functions/jsondecode.html), for example, `jsondecode(data.aws_cloudcontrolapi_resource.example.properties)["example"]`. From a335bafacb181aece18c566f98745c0b133560d6 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 16 Sep 2021 12:22:10 -0400 Subject: [PATCH 19/33] Tidy up CloudFormation Type, Stack and StackSet finders. --- ...rce_request_status_status.go => status.go} | 0 ...rce_request_status_waiter.go => waiter.go} | 0 aws/internal/service/cloudformation/errors.go | 32 ++++ .../service/cloudformation/finder/finder.go | 138 +++++++++++++++--- .../service/cloudformation/waiter/status.go | 69 ++------- .../service/cloudformation/waiter/waiter.go | 50 +++++-- aws/resource_aws_cloudformation_stack_set.go | 2 +- ...e_aws_cloudformation_stack_set_instance.go | 8 +- ..._cloudformation_stack_set_instance_test.go | 2 +- aws/resource_aws_cloudformation_type.go | 38 ++--- aws/resource_aws_cloudformation_type_test.go | 44 ++---- ...licationrepository_cloudformation_stack.go | 4 +- 12 files changed, 223 insertions(+), 164 deletions(-) rename aws/internal/service/cloudcontrolapi/waiter/{resource_request_status_status.go => status.go} (100%) rename aws/internal/service/cloudcontrolapi/waiter/{resource_request_status_waiter.go => waiter.go} (100%) create mode 100644 aws/internal/service/cloudformation/errors.go diff --git a/aws/internal/service/cloudcontrolapi/waiter/resource_request_status_status.go b/aws/internal/service/cloudcontrolapi/waiter/status.go similarity index 100% rename from aws/internal/service/cloudcontrolapi/waiter/resource_request_status_status.go rename to aws/internal/service/cloudcontrolapi/waiter/status.go diff --git a/aws/internal/service/cloudcontrolapi/waiter/resource_request_status_waiter.go b/aws/internal/service/cloudcontrolapi/waiter/waiter.go similarity index 100% rename from aws/internal/service/cloudcontrolapi/waiter/resource_request_status_waiter.go rename to aws/internal/service/cloudcontrolapi/waiter/waiter.go diff --git a/aws/internal/service/cloudformation/errors.go b/aws/internal/service/cloudformation/errors.go new file mode 100644 index 00000000000..28e5473ed14 --- /dev/null +++ b/aws/internal/service/cloudformation/errors.go @@ -0,0 +1,32 @@ +package cloudformation + +import ( + "fmt" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/cloudformation" + multierror "github.com/hashicorp/go-multierror" +) + +const ( + ErrCodeValidationError = "ValidationError" +) + +func StackSetOperationError(apiObjects []*cloudformation.StackSetOperationResultSummary) error { + var errors *multierror.Error + + for _, apiObject := range apiObjects { + if apiObject == nil { + continue + } + + errors = multierror.Append(errors, fmt.Errorf("Account (%s) Region (%s) Status (%s) Status Reason: %s", + aws.StringValue(apiObject.Account), + aws.StringValue(apiObject.Region), + aws.StringValue(apiObject.Status), + aws.StringValue(apiObject.StatusReason), + )) + } + + return errors.ErrorOrNil() +} diff --git a/aws/internal/service/cloudformation/finder/finder.go b/aws/internal/service/cloudformation/finder/finder.go index 88f58fed5ba..9a0cfc6ca51 100644 --- a/aws/internal/service/cloudformation/finder/finder.go +++ b/aws/internal/service/cloudformation/finder/finder.go @@ -1,56 +1,146 @@ package finder import ( - "log" + "context" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudformation" "github.com/hashicorp/aws-sdk-go-base/tfawserr" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + tfcloudformation "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/cloudformation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/tfresource" ) -func Stack(conn *cloudformation.CloudFormation, stackID string) (*cloudformation.Stack, error) { +func StackByID(conn *cloudformation.CloudFormation, id string) (*cloudformation.Stack, error) { input := &cloudformation.DescribeStacksInput{ - StackName: aws.String(stackID), + StackName: aws.String(id), } - log.Printf("[DEBUG] Querying CloudFormation Stack: %s", input) - resp, err := conn.DescribeStacks(input) - if tfawserr.ErrCodeEquals(err, "ValidationError") { + + output, err := conn.DescribeStacks(input) + + if tfawserr.ErrMessageContains(err, tfcloudformation.ErrCodeValidationError, "does not exist") { return nil, &resource.NotFoundError{ - LastError: err, - LastRequest: input, - LastResponse: resp, + LastError: err, + LastRequest: input, } } + if err != nil { return nil, err } - if resp == nil { + if output == nil || len(output.Stacks) == 0 || output.Stacks[0] == nil { + return nil, tfresource.NewEmptyResultError(input) + } + + if count := len(output.Stacks); count > 1 { + return nil, tfresource.NewTooManyResultsError(count, input) + } + + stack := output.Stacks[0] + + if status := aws.StringValue(stack.StackStatus); status == cloudformation.StackStatusDeleteComplete { return nil, &resource.NotFoundError{ - LastRequest: input, - LastResponse: resp, - Message: "returned empty response", + LastRequest: input, + Message: status, } + } + + return stack, nil +} +func StackSetOperationByStackSetNameAndOperationID(conn *cloudformation.CloudFormation, stackSetName, operationID string) (*cloudformation.StackSetOperation, error) { + input := &cloudformation.DescribeStackSetOperationInput{ + OperationId: aws.String(operationID), + StackSetName: aws.String(stackSetName), } - stacks := resp.Stacks - if len(stacks) < 1 { + + output, err := conn.DescribeStackSetOperation(input) + + if tfawserr.ErrCodeEquals(err, cloudformation.ErrCodeOperationNotFoundException) { return nil, &resource.NotFoundError{ - LastRequest: input, - LastResponse: resp, - Message: "returned no results", + LastError: err, + LastRequest: input, } } - stack := stacks[0] - if aws.StringValue(stack.StackStatus) == cloudformation.StackStatusDeleteComplete { + if err != nil { + return nil, err + } + + if output == nil || output.StackSetOperation == nil { + return nil, tfresource.NewEmptyResultError(input) + } + + return output.StackSetOperation, nil +} + +func TypeByARN(ctx context.Context, conn *cloudformation.CloudFormation, arn string) (*cloudformation.DescribeTypeOutput, error) { + input := &cloudformation.DescribeTypeInput{ + Arn: aws.String(arn), + } + + return Type(ctx, conn, input) +} + +func TypeByName(ctx context.Context, conn *cloudformation.CloudFormation, name string) (*cloudformation.DescribeTypeOutput, error) { + input := &cloudformation.DescribeTypeInput{ + Type: aws.String(cloudformation.RegistryTypeResource), + TypeName: aws.String(name), + } + + return Type(ctx, conn, input) +} + +func Type(ctx context.Context, conn *cloudformation.CloudFormation, input *cloudformation.DescribeTypeInput) (*cloudformation.DescribeTypeOutput, error) { + output, err := conn.DescribeTypeWithContext(ctx, input) + + if tfawserr.ErrCodeEquals(err, cloudformation.ErrCodeTypeNotFoundException) { return nil, &resource.NotFoundError{ - LastRequest: input, - LastResponse: resp, - Message: "CloudFormation Stack deleted", + LastError: err, + LastRequest: input, } } - return stack, nil + if err != nil { + return nil, err + } + + if output == nil { + return nil, tfresource.NewEmptyResultError(input) + } + + if status := aws.StringValue(output.DeprecatedStatus); status == cloudformation.DeprecatedStatusDeprecated { + return nil, &resource.NotFoundError{ + LastRequest: input, + Message: status, + } + } + + return output, nil +} + +func TypeRegistrationByToken(ctx context.Context, conn *cloudformation.CloudFormation, registrationToken string) (*cloudformation.DescribeTypeRegistrationOutput, error) { + input := &cloudformation.DescribeTypeRegistrationInput{ + RegistrationToken: aws.String(registrationToken), + } + + output, err := conn.DescribeTypeRegistrationWithContext(ctx, input) + + if tfawserr.ErrMessageContains(err, cloudformation.ErrCodeCFNRegistryException, "No registration token matches") { + return nil, &resource.NotFoundError{ + LastError: err, + LastRequest: input, + } + } + + if err != nil { + return nil, err + } + + if output == nil { + return nil, tfresource.NewEmptyResultError(input) + } + + return output, nil } diff --git a/aws/internal/service/cloudformation/waiter/status.go b/aws/internal/service/cloudformation/waiter/status.go index fa3ea9de032..09a1efb5e00 100644 --- a/aws/internal/service/cloudformation/waiter/status.go +++ b/aws/internal/service/cloudformation/waiter/status.go @@ -2,14 +2,13 @@ package waiter import ( "context" - "fmt" "log" - "strings" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudformation" - "github.com/hashicorp/aws-sdk-go-base/tfawserr" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/cloudformation/finder" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/tfresource" ) func ChangeSetStatus(conn *cloudformation.CloudFormation, stackID, changeSetName string) resource.StateRefreshFunc { @@ -36,59 +35,17 @@ func ChangeSetStatus(conn *cloudformation.CloudFormation, stackID, changeSetName func StackSetOperationStatus(conn *cloudformation.CloudFormation, stackSetName, operationID string) resource.StateRefreshFunc { return func() (interface{}, string, error) { - input := &cloudformation.DescribeStackSetOperationInput{ - OperationId: aws.String(operationID), - StackSetName: aws.String(stackSetName), - } - - output, err := conn.DescribeStackSetOperation(input) + output, err := finder.StackSetOperationByStackSetNameAndOperationID(conn, stackSetName, operationID) - if tfawserr.ErrCodeEquals(err, cloudformation.ErrCodeOperationNotFoundException) { - return nil, cloudformation.StackSetOperationStatusRunning, nil + if tfresource.NotFound(err) { + return nil, "", nil } if err != nil { - return nil, cloudformation.StackSetOperationStatusFailed, err - } - - if output == nil || output.StackSetOperation == nil { - return nil, cloudformation.StackSetOperationStatusRunning, nil - } - - if aws.StringValue(output.StackSetOperation.Status) == cloudformation.StackSetOperationStatusFailed { - allResults := make([]string, 0) - listOperationResultsInput := &cloudformation.ListStackSetOperationResultsInput{ - OperationId: aws.String(operationID), - StackSetName: aws.String(stackSetName), - } - - // TODO: PAGES - for { - listOperationResultsOutput, err := conn.ListStackSetOperationResults(listOperationResultsInput) - - if err != nil { - return output.StackSetOperation, cloudformation.StackSetOperationStatusFailed, fmt.Errorf("error listing Operation (%s) errors: %w", operationID, err) - } - - if listOperationResultsOutput == nil { - continue - } - - for _, summary := range listOperationResultsOutput.Summaries { - allResults = append(allResults, fmt.Sprintf("Account (%s) Region (%s) Status (%s) Status Reason: %s", aws.StringValue(summary.Account), aws.StringValue(summary.Region), aws.StringValue(summary.Status), aws.StringValue(summary.StatusReason))) - } - - if aws.StringValue(listOperationResultsOutput.NextToken) == "" { - break - } - - listOperationResultsInput.NextToken = listOperationResultsOutput.NextToken - } - - return output.StackSetOperation, cloudformation.StackSetOperationStatusFailed, fmt.Errorf("Operation (%s) Results:\n%s", operationID, strings.Join(allResults, "\n")) + return nil, "", err } - return output.StackSetOperation, aws.StringValue(output.StackSetOperation.Status), nil + return output, aws.StringValue(output.Status), nil } } @@ -116,20 +73,16 @@ func StackStatus(conn *cloudformation.CloudFormation, stackName string) resource func TypeRegistrationProgressStatus(ctx context.Context, conn *cloudformation.CloudFormation, registrationToken string) resource.StateRefreshFunc { return func() (interface{}, string, error) { - input := &cloudformation.DescribeTypeRegistrationInput{ - RegistrationToken: aws.String(registrationToken), - } + output, err := finder.TypeRegistrationByToken(ctx, conn, registrationToken) - output, err := conn.DescribeTypeRegistrationWithContext(ctx, input) + if tfresource.NotFound(err) { + return nil, "", nil + } if err != nil { return nil, "", err } - if output == nil { - return nil, "", nil - } - return output, aws.StringValue(output.ProgressStatus), nil } } diff --git a/aws/internal/service/cloudformation/waiter/waiter.go b/aws/internal/service/cloudformation/waiter/waiter.go index 4427367303d..1c0983ec5e0 100644 --- a/aws/internal/service/cloudformation/waiter/waiter.go +++ b/aws/internal/service/cloudformation/waiter/waiter.go @@ -4,14 +4,15 @@ import ( "context" "errors" "fmt" - "log" "strings" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudformation" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + tfcloudformation "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/cloudformation" "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/cloudformation/lister" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/tfresource" ) const ( @@ -61,7 +62,7 @@ const ( StackSetUpdatedDefaultTimeout = 30 * time.Minute ) -func StackSetOperationSucceeded(conn *cloudformation.CloudFormation, stackSetName, operationID string, timeout time.Duration) error { +func StackSetOperationSucceeded(conn *cloudformation.CloudFormation, stackSetName, operationID string, timeout time.Duration) (*cloudformation.StackSetOperation, error) { stateConf := &resource.StateChangeConf{ Pending: []string{cloudformation.StackSetOperationStatusRunning}, Target: []string{cloudformation.StackSetOperationStatusSucceeded}, @@ -70,10 +71,37 @@ func StackSetOperationSucceeded(conn *cloudformation.CloudFormation, stackSetNam Delay: stackSetOperationDelay, } - log.Printf("[DEBUG] Waiting for CloudFormation StackSet (%s) operation: %s", stackSetName, operationID) - _, err := stateConf.WaitForState() + outputRaw, err := stateConf.WaitForState() + + if output, ok := outputRaw.(*cloudformation.StackSetOperation); ok { + if status := aws.StringValue(output.Status); status == cloudformation.StackSetOperationStatusFailed { + input := &cloudformation.ListStackSetOperationResultsInput{ + OperationId: aws.String(operationID), + StackSetName: aws.String(stackSetName), + } + var summaries []*cloudformation.StackSetOperationResultSummary + + err := conn.ListStackSetOperationResultsPages(input, func(page *cloudformation.ListStackSetOperationResultsOutput, lastPage bool) bool { + if page == nil { + return !lastPage + } + + summaries = append(summaries, page.Summaries...) + + return !lastPage + }) + + if err != nil { + return nil, fmt.Errorf("error listing CloudFormation Stack Set (%s) Operation (%s) results: %w", stackSetName, operationID, err) + } - return err + tfresource.SetLastError(err, fmt.Errorf("Operation (%s) Results:\n%w", operationID, tfcloudformation.StackSetOperationError(summaries))) + } + + return output, err + } + + return nil, err } const ( @@ -252,16 +280,8 @@ func TypeRegistrationProgressStatusComplete(ctx context.Context, conn *cloudform outputRaw, err := stateConf.WaitForState() if output, ok := outputRaw.(*cloudformation.DescribeTypeRegistrationOutput); ok { - if err != nil && output != nil { - newErr := errors.New(aws.StringValue(output.Description)) - - var te *resource.TimeoutError - var use *resource.UnexpectedStateError - if ok := errors.As(err, &te); ok && te.LastError == nil { - te.LastError = newErr - } else if ok := errors.As(err, &use); ok && use.LastError == nil { - use.LastError = newErr - } + if status := aws.StringValue(output.ProgressStatus); status == cloudformation.RegistrationStatusFailed { + tfresource.SetLastError(err, errors.New(aws.StringValue(output.Description))) } return output, err diff --git a/aws/resource_aws_cloudformation_stack_set.go b/aws/resource_aws_cloudformation_stack_set.go index a29e763b780..17a341050fc 100644 --- a/aws/resource_aws_cloudformation_stack_set.go +++ b/aws/resource_aws_cloudformation_stack_set.go @@ -320,7 +320,7 @@ func resourceAwsCloudFormationStackSetUpdate(d *schema.ResourceData, meta interf return fmt.Errorf("error updating CloudFormation StackSet (%s): %s", d.Id(), err) } - if err := waiter.StackSetOperationSucceeded(conn, d.Id(), aws.StringValue(output.OperationId), d.Timeout(schema.TimeoutUpdate)); err != nil { + if _, err := waiter.StackSetOperationSucceeded(conn, d.Id(), aws.StringValue(output.OperationId), d.Timeout(schema.TimeoutUpdate)); err != nil { return fmt.Errorf("error waiting for CloudFormation StackSet (%s) update: %s", d.Id(), err) } diff --git a/aws/resource_aws_cloudformation_stack_set_instance.go b/aws/resource_aws_cloudformation_stack_set_instance.go index 9c11dfcea82..7f82339d8e3 100644 --- a/aws/resource_aws_cloudformation_stack_set_instance.go +++ b/aws/resource_aws_cloudformation_stack_set_instance.go @@ -105,7 +105,7 @@ func resourceAwsCloudFormationStackSetInstanceCreate(d *schema.ResourceData, met d.SetId(fmt.Sprintf("%s,%s,%s", stackSetName, accountID, region)) - err = waiter.StackSetOperationSucceeded(conn, stackSetName, aws.StringValue(output.OperationId), d.Timeout(schema.TimeoutCreate)) + _, err = waiter.StackSetOperationSucceeded(conn, stackSetName, aws.StringValue(output.OperationId), d.Timeout(schema.TimeoutCreate)) if err != nil { // IAM eventual consistency @@ -157,7 +157,7 @@ func resourceAwsCloudFormationStackSetInstanceCreate(d *schema.ResourceData, met d.SetId(fmt.Sprintf("%s,%s,%s", stackSetName, accountID, region)) - err = waiter.StackSetOperationSucceeded(conn, stackSetName, aws.StringValue(output.OperationId), d.Timeout(schema.TimeoutCreate)) + _, err = waiter.StackSetOperationSucceeded(conn, stackSetName, aws.StringValue(output.OperationId), d.Timeout(schema.TimeoutCreate)) if err != nil { return fmt.Errorf("error waiting for CloudFormation StackSet Instance (%s) creation: %w", d.Id(), err) @@ -253,7 +253,7 @@ func resourceAwsCloudFormationStackSetInstanceUpdate(d *schema.ResourceData, met return fmt.Errorf("error updating CloudFormation StackSet Instance (%s): %s", d.Id(), err) } - if err := waiter.StackSetOperationSucceeded(conn, stackSetName, aws.StringValue(output.OperationId), d.Timeout(schema.TimeoutUpdate)); err != nil { + if _, err := waiter.StackSetOperationSucceeded(conn, stackSetName, aws.StringValue(output.OperationId), d.Timeout(schema.TimeoutUpdate)); err != nil { return fmt.Errorf("error waiting for CloudFormation StackSet Instance (%s) update: %s", d.Id(), err) } } @@ -293,7 +293,7 @@ func resourceAwsCloudFormationStackSetInstanceDelete(d *schema.ResourceData, met return fmt.Errorf("error deleting CloudFormation StackSet Instance (%s): %s", d.Id(), err) } - if err := waiter.StackSetOperationSucceeded(conn, stackSetName, aws.StringValue(output.OperationId), d.Timeout(schema.TimeoutDelete)); err != nil { + if _, err := waiter.StackSetOperationSucceeded(conn, stackSetName, aws.StringValue(output.OperationId), d.Timeout(schema.TimeoutDelete)); err != nil { return fmt.Errorf("error waiting for CloudFormation StackSet Instance (%s) deletion: %s", d.Id(), err) } diff --git a/aws/resource_aws_cloudformation_stack_set_instance_test.go b/aws/resource_aws_cloudformation_stack_set_instance_test.go index 3bbb9f6bafc..6d6c1923f39 100644 --- a/aws/resource_aws_cloudformation_stack_set_instance_test.go +++ b/aws/resource_aws_cloudformation_stack_set_instance_test.go @@ -84,7 +84,7 @@ func testSweepCloudformationStackSetInstances(region string) error { continue } - if err := waiter.StackSetOperationSucceeded(conn, stackSetName, aws.StringValue(output.OperationId), waiter.StackSetInstanceDeletedDefaultTimeout); err != nil { + if _, err := waiter.StackSetOperationSucceeded(conn, stackSetName, aws.StringValue(output.OperationId), waiter.StackSetInstanceDeletedDefaultTimeout); err != nil { sweeperErr := fmt.Errorf("error waiting for CloudFormation StackSet Instance (%s) deletion: %w", id, err) log.Printf("[ERROR] %s", sweeperErr) sweeperErrs = multierror.Append(sweeperErrs, sweeperErr) diff --git a/aws/resource_aws_cloudformation_type.go b/aws/resource_aws_cloudformation_type.go index 0bdae572012..c3181d3d9da 100644 --- a/aws/resource_aws_cloudformation_type.go +++ b/aws/resource_aws_cloudformation_type.go @@ -14,7 +14,9 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" tfcloudformation "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/cloudformation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/cloudformation/finder" "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/cloudformation/waiter" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/tfresource" ) func resourceAwsCloudFormationType() *schema.Resource { @@ -131,10 +133,12 @@ func resourceAwsCloudFormationType() *schema.Resource { func resourceAwsCloudFormationTypeCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { conn := meta.(*AWSClient).cfconn + typeName := d.Get("type_name").(string) input := &cloudformation.RegisterTypeInput{ - ClientRequestToken: aws.String(resource.UniqueId()), - TypeName: aws.String(typeName), + ClientRequestToken: aws.String(resource.UniqueId()), + SchemaHandlerPackage: aws.String(d.Get("schema_handler_package").(string)), + TypeName: aws.String(typeName), } if v, ok := d.GetOk("execution_role_arn"); ok { @@ -145,10 +149,6 @@ func resourceAwsCloudFormationTypeCreate(ctx context.Context, d *schema.Resource input.LoggingConfig = expandCloudformationLoggingConfig(v.([]interface{})[0].(map[string]interface{})) } - if v, ok := d.GetOk("schema_handler_package"); ok { - input.SchemaHandlerPackage = aws.String(v.(string)) - } - if v, ok := d.GetOk("type"); ok { input.Type = aws.String(v.(string)) } @@ -160,13 +160,13 @@ func resourceAwsCloudFormationTypeCreate(ctx context.Context, d *schema.Resource } if output == nil || output.RegistrationToken == nil { - return diag.FromErr(fmt.Errorf("error registering CloudFormation Type (%s): empty response", typeName)) + return diag.FromErr(fmt.Errorf("error registering CloudFormation Type (%s): empty result", typeName)) } registrationOutput, err := waiter.TypeRegistrationProgressStatusComplete(ctx, conn, aws.StringValue(output.RegistrationToken)) if err != nil { - return diag.FromErr(fmt.Errorf("error waiting for CloudFormation Type (%s) registration: %w", typeName, err)) + return diag.FromErr(fmt.Errorf("error waiting for CloudFormation Type (%s) register: %w", typeName, err)) } // Type Version ARN is not available until after registration is complete @@ -178,13 +178,9 @@ func resourceAwsCloudFormationTypeCreate(ctx context.Context, d *schema.Resource func resourceAwsCloudFormationTypeRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { conn := meta.(*AWSClient).cfconn - input := &cloudformation.DescribeTypeInput{ - Arn: aws.String(d.Id()), - } - - output, err := conn.DescribeTypeWithContext(ctx, input) + output, err := finder.TypeByARN(ctx, conn, d.Id()) - if !d.IsNewResource() && tfawserr.ErrCodeEquals(err, cloudformation.ErrCodeTypeNotFoundException) { + if !d.IsNewResource() && tfresource.NotFound(err) { log.Printf("[WARN] CloudFormation Type (%s) not found, removing from state", d.Id()) d.SetId("") return nil @@ -194,20 +190,6 @@ func resourceAwsCloudFormationTypeRead(ctx context.Context, d *schema.ResourceDa return diag.FromErr(fmt.Errorf("error reading CloudFormation Type (%s): %w", d.Id(), err)) } - if output == nil { - return diag.FromErr(fmt.Errorf("error reading CloudFormation Type (%s): empty response", d.Id())) - } - - if aws.StringValue(output.DeprecatedStatus) == cloudformation.DeprecatedStatusDeprecated { - if d.IsNewResource() { - return diag.FromErr(fmt.Errorf("error reading CloudFormation Type (%s): deprecated after creation", d.Id())) - } - - log.Printf("[WARN] CloudFormation Type (%s) %s, removing from state", d.Id(), aws.StringValue(output.DeprecatedStatus)) - d.SetId("") - return nil - } - typeARN, versionID, err := tfcloudformation.TypeVersionARNToTypeARNAndVersionID(d.Id()) if err != nil { diff --git a/aws/resource_aws_cloudformation_type_test.go b/aws/resource_aws_cloudformation_type_test.go index fcbff8deb50..a1b0349463d 100644 --- a/aws/resource_aws_cloudformation_type_test.go +++ b/aws/resource_aws_cloudformation_type_test.go @@ -2,6 +2,7 @@ package aws import ( "archive/zip" + "context" "errors" "fmt" "io" @@ -12,12 +13,12 @@ import ( "strings" "testing" - "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudformation" - "github.com/hashicorp/aws-sdk-go-base/tfawserr" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/cloudformation/finder" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/tfresource" ) func TestAccAwsCloudformationType_basic(t *testing.T) { @@ -138,29 +139,20 @@ func TestAccAwsCloudformationType_LoggingConfig(t *testing.T) { func testAccCheckAwsCloudformationTypeExists(resourceName string) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[resourceName] - if !ok { return fmt.Errorf("Not found: %s", resourceName) } - conn := testAccProvider.Meta().(*AWSClient).cfconn - - input := &cloudformation.DescribeTypeInput{ - Arn: aws.String(rs.Primary.ID), + if rs.Primary.ID == "" { + return fmt.Errorf("No CloudFormation Type ID is set") } - output, err := conn.DescribeType(input) - - if err != nil { - return fmt.Errorf("error reading CloudFormation Type (%s): %w", rs.Primary.ID, err) - } + conn := testAccProvider.Meta().(*AWSClient).cfconn - if output == nil { - return fmt.Errorf("error reading CloudFormation Type (%s): empty response", rs.Primary.ID) - } + _, err := finder.TypeByARN(context.TODO(), conn, rs.Primary.ID) - if aws.StringValue(output.DeprecatedStatus) != cloudformation.DeprecatedStatusLive { - return fmt.Errorf("error reading CloudFormation Type (%s): unexpected deprecated status: %s", rs.Primary.ID, aws.StringValue(output.DeprecatedStatus)) + if err != nil { + return err } return nil @@ -175,27 +167,17 @@ func testAccCheckAwsCloudformationTypeDestroy(s *terraform.State) error { continue } - input := &cloudformation.DescribeTypeInput{ - Arn: aws.String(rs.Primary.ID), - } - - output, err := conn.DescribeType(input) + _, err := finder.TypeByARN(context.TODO(), conn, rs.Primary.ID) - if tfawserr.ErrCodeEquals(err, cloudformation.ErrCodeTypeNotFoundException) { + if tfresource.NotFound(err) { continue } if err != nil { - return fmt.Errorf("error reading CloudFormation Type (%s): %w", rs.Primary.ID, err) + return err } - if output == nil { - return fmt.Errorf("error reading CloudFormation Type (%s): empty response", rs.Primary.ID) - } - - if aws.StringValue(output.DeprecatedStatus) != cloudformation.DeprecatedStatusDeprecated { - return fmt.Errorf("error reading CloudFormation Type (%s): unexpected deprecated status: %s", rs.Primary.ID, aws.StringValue(output.DeprecatedStatus)) - } + return fmt.Errorf("CloudFormation Type %s still exists", rs.Primary.ID) } return nil diff --git a/aws/resource_aws_serverlessapplicationrepository_cloudformation_stack.go b/aws/resource_aws_serverlessapplicationrepository_cloudformation_stack.go index 2bd208ec6af..bc734e3f475 100644 --- a/aws/resource_aws_serverlessapplicationrepository_cloudformation_stack.go +++ b/aws/resource_aws_serverlessapplicationrepository_cloudformation_stack.go @@ -129,7 +129,7 @@ func resourceAwsServerlessApplicationRepositoryCloudFormationStackRead(d *schema defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig ignoreTagsConfig := meta.(*AWSClient).IgnoreTagsConfig - stack, err := cffinder.Stack(cfConn, d.Id()) + stack, err := cffinder.StackByID(cfConn, d.Id()) if tfresource.NotFound(err) { log.Printf("[WARN] Serverless Application Repository CloudFormation Stack (%s) not found, removing from state", d.Id()) d.SetId("") @@ -285,7 +285,7 @@ func resourceAwsServerlessApplicationRepositoryCloudFormationStackImport(d *sche } cfConn := meta.(*AWSClient).cfconn - stack, err := cffinder.Stack(cfConn, stackID) + stack, err := cffinder.StackByID(cfConn, stackID) if err != nil { return nil, fmt.Errorf("error describing Serverless Application Repository CloudFormation Stack (%s): %w", stackID, err) } From 12e3009e135b8679cad4239fc672311d5db447c2 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 16 Sep 2021 13:26:03 -0400 Subject: [PATCH 20/33] Add and use 'internal/service/cloudcontrolapi/finder'. --- ...ata_source_aws_cloudcontrolapi_resource.go | 38 ++----- .../service/cloudcontrolapi/finder/finder.go | 78 +++++++++++++ .../service/cloudcontrolapi/waiter/status.go | 18 ++- .../service/cloudcontrolapi/waiter/waiter.go | 24 ++-- aws/resource_aws_cloudcontrolapi_resource.go | 105 ++++++------------ ...ource_aws_cloudcontrolapi_resource_test.go | 26 ++--- 6 files changed, 146 insertions(+), 143 deletions(-) create mode 100644 aws/internal/service/cloudcontrolapi/finder/finder.go diff --git a/aws/data_source_aws_cloudcontrolapi_resource.go b/aws/data_source_aws_cloudcontrolapi_resource.go index 06bcae69fa9..ea9307205dd 100644 --- a/aws/data_source_aws_cloudcontrolapi_resource.go +++ b/aws/data_source_aws_cloudcontrolapi_resource.go @@ -6,10 +6,10 @@ import ( "regexp" "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/cloudcontrolapi" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/cloudcontrolapi/finder" ) func dataSourceAwsCloudControlApiResource() *schema.Resource { @@ -45,37 +45,21 @@ func dataSourceAwsCloudControlApiResource() *schema.Resource { func dataSourceAwsCloudControlApiResourceRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { conn := meta.(*AWSClient).cloudcontrolapiconn - input := &cloudcontrolapi.GetResourceInput{} - - if v, ok := d.GetOk("identifier"); ok { - input.Identifier = aws.String(v.(string)) - } - - if v, ok := d.GetOk("role_arn"); ok { - input.RoleArn = aws.String(v.(string)) - } - - if v, ok := d.GetOk("type_name"); ok { - input.TypeName = aws.String(v.(string)) - } - - if v, ok := d.GetOk("type_version_id"); ok { - input.TypeVersionId = aws.String(v.(string)) - } - - output, err := conn.GetResourceWithContext(ctx, input) + identifier := d.Get("identifier").(string) + resourceDescription, err := finder.ResourceByID(ctx, conn, + identifier, + d.Get("type_name").(string), + d.Get("type_version_id").(string), + d.Get("role_arn").(string), + ) if err != nil { - return diag.FromErr(fmt.Errorf("error reading CloudFormation Resource: %w", err)) - } - - if output == nil || output.ResourceDescription == nil { - return diag.FromErr(fmt.Errorf("error reading CloudFormation Resource: empty response")) + return diag.FromErr(fmt.Errorf("error reading Cloud Control API Resource (%s): %w", identifier, err)) } - d.SetId(aws.StringValue(output.ResourceDescription.Identifier)) + d.SetId(aws.StringValue(resourceDescription.Identifier)) - d.Set("properties", output.ResourceDescription.Properties) + d.Set("properties", resourceDescription.Properties) return nil } diff --git a/aws/internal/service/cloudcontrolapi/finder/finder.go b/aws/internal/service/cloudcontrolapi/finder/finder.go new file mode 100644 index 00000000000..3da4855c49a --- /dev/null +++ b/aws/internal/service/cloudcontrolapi/finder/finder.go @@ -0,0 +1,78 @@ +package finder + +import ( + "context" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/cloudcontrolapi" + "github.com/hashicorp/aws-sdk-go-base/tfawserr" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/tfresource" +) + +func ProgressEventByRequestToken(ctx context.Context, conn *cloudcontrolapi.CloudControlApi, requestToken string) (*cloudcontrolapi.ProgressEvent, error) { + input := &cloudcontrolapi.GetResourceRequestStatusInput{ + RequestToken: aws.String(requestToken), + } + + output, err := conn.GetResourceRequestStatusWithContext(ctx, input) + + if tfawserr.ErrCodeEquals(err, cloudcontrolapi.ErrCodeRequestTokenNotFoundException) { + return nil, &resource.NotFoundError{ + LastError: err, + LastRequest: input, + } + } + + if err != nil { + return nil, err + } + + if output == nil || output.ProgressEvent == nil { + return nil, tfresource.NewEmptyResultError(input) + } + + return output.ProgressEvent, nil +} + +func ResourceByID(ctx context.Context, conn *cloudcontrolapi.CloudControlApi, resourceID, typeName, typeVersionID, roleARN string) (*cloudcontrolapi.ResourceDescription, error) { + input := &cloudcontrolapi.GetResourceInput{ + Identifier: aws.String(resourceID), + TypeName: aws.String(typeName), + } + if roleARN != "" { + input.RoleArn = aws.String(roleARN) + } + if typeVersionID != "" { + input.TypeVersionId = aws.String(typeVersionID) + } + + output, err := conn.GetResourceWithContext(ctx, input) + + if tfawserr.ErrCodeEquals(err, cloudcontrolapi.ErrCodeResourceNotFoundException) { + return nil, &resource.NotFoundError{ + LastError: err, + LastRequest: input, + } + } + + // TEMPORARY: + // Some CloudFormation Resources do not correctly re-map "not found" errors, instead returning a HandlerFailureException. + // These should be reported and fixed upstream over time, but for now work around the issue. + if tfawserr.ErrMessageContains(err, cloudcontrolapi.ErrCodeHandlerFailureException, "not found") { + return nil, &resource.NotFoundError{ + LastError: err, + LastRequest: input, + } + } + + if err != nil { + return nil, err + } + + if output == nil || output.ResourceDescription == nil { + return nil, tfresource.NewEmptyResultError(input) + } + + return output.ResourceDescription, nil +} diff --git a/aws/internal/service/cloudcontrolapi/waiter/status.go b/aws/internal/service/cloudcontrolapi/waiter/status.go index 6942c58bbda..f4169f6ddb5 100644 --- a/aws/internal/service/cloudcontrolapi/waiter/status.go +++ b/aws/internal/service/cloudcontrolapi/waiter/status.go @@ -6,24 +6,22 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudcontrolapi" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/cloudcontrolapi/finder" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/tfresource" ) -func ResourceRequestStatusProgressEventOperationStatus(ctx context.Context, conn *cloudcontrolapi.CloudControlApi, requestToken string) resource.StateRefreshFunc { +func ProgressEventOperationStatus(ctx context.Context, conn *cloudcontrolapi.CloudControlApi, requestToken string) resource.StateRefreshFunc { return func() (interface{}, string, error) { - input := &cloudcontrolapi.GetResourceRequestStatusInput{ - RequestToken: aws.String(requestToken), - } + output, err := finder.ProgressEventByRequestToken(ctx, conn, requestToken) - output, err := conn.GetResourceRequestStatusWithContext(ctx, input) + if tfresource.NotFound(err) { + return nil, "", nil + } if err != nil { return nil, "", err } - if output == nil || output.ProgressEvent == nil { - return nil, "", nil - } - - return output.ProgressEvent, aws.StringValue(output.ProgressEvent.OperationStatus), nil + return output, aws.StringValue(output.OperationStatus), nil } } diff --git a/aws/internal/service/cloudcontrolapi/waiter/waiter.go b/aws/internal/service/cloudcontrolapi/waiter/waiter.go index 4d4517b0555..f525aca9e2c 100644 --- a/aws/internal/service/cloudcontrolapi/waiter/waiter.go +++ b/aws/internal/service/cloudcontrolapi/waiter/waiter.go @@ -2,38 +2,28 @@ package waiter import ( "context" - "errors" "fmt" "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudcontrolapi" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/tfresource" ) -func ResourceRequestStatusProgressEventOperationStatusSuccess(ctx context.Context, conn *cloudcontrolapi.CloudControlApi, requestToken string, timeout time.Duration) (*cloudcontrolapi.ProgressEvent, error) { +func ProgressEventOperationStatusSuccess(ctx context.Context, conn *cloudcontrolapi.CloudControlApi, requestToken string, timeout time.Duration) (*cloudcontrolapi.ProgressEvent, error) { stateConf := &resource.StateChangeConf{ - Pending: []string{ - cloudcontrolapi.OperationStatusInProgress, - cloudcontrolapi.OperationStatusPending, - }, + Pending: []string{cloudcontrolapi.OperationStatusInProgress, cloudcontrolapi.OperationStatusPending}, Target: []string{cloudcontrolapi.OperationStatusSuccess}, - Refresh: ResourceRequestStatusProgressEventOperationStatus(ctx, conn, requestToken), + Refresh: ProgressEventOperationStatus(ctx, conn, requestToken), Timeout: timeout, } outputRaw, err := stateConf.WaitForStateContext(ctx) if output, ok := outputRaw.(*cloudcontrolapi.ProgressEvent); ok { - if err != nil && output != nil { - newErr := fmt.Errorf("%s", output) - - var te *resource.TimeoutError - var use *resource.UnexpectedStateError - if ok := errors.As(err, &te); ok && te.LastError == nil { - te.LastError = newErr - } else if ok := errors.As(err, &use); ok && use.LastError == nil { - use.LastError = newErr - } + if operationStatus := aws.StringValue(output.OperationStatus); operationStatus == cloudcontrolapi.OperationStatusFailed { + tfresource.SetLastError(err, fmt.Errorf("%s: %s", aws.StringValue(output.ErrorCode), aws.StringValue(output.StatusMessage))) } return output, err diff --git a/aws/resource_aws_cloudcontrolapi_resource.go b/aws/resource_aws_cloudcontrolapi_resource.go index 2b6241c821d..7c3ab456311 100644 --- a/aws/resource_aws_cloudcontrolapi_resource.go +++ b/aws/resource_aws_cloudcontrolapi_resource.go @@ -10,16 +10,17 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudcontrolapi" - "github.com/aws/aws-sdk-go/service/cloudformation" cfschema "github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go" - "github.com/hashicorp/aws-sdk-go-base/tfawserr" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/mattbaird/jsonpatch" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/cloudcontrolapi/finder" "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/cloudcontrolapi/waiter" + cffinder "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/cloudformation/finder" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/tfresource" ) func resourceAwsCloudControlApiResource() *schema.Resource { @@ -79,22 +80,17 @@ func resourceAwsCloudControlApiResource() *schema.Resource { func resourceAwsCloudControlApiResourceCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { conn := meta.(*AWSClient).cloudcontrolapiconn + typeName := d.Get("type_name").(string) input := &cloudcontrolapi.CreateResourceInput{ - ClientToken: aws.String(resource.UniqueId()), - } - - if v, ok := d.GetOk("desired_state"); ok { - input.DesiredState = aws.String(v.(string)) + ClientToken: aws.String(resource.UniqueId()), + DesiredState: aws.String(d.Get("desired_state").(string)), + TypeName: aws.String(typeName), } if v, ok := d.GetOk("role_arn"); ok { input.RoleArn = aws.String(v.(string)) } - if v, ok := d.GetOk("type_name"); ok { - input.TypeName = aws.String(v.(string)) - } - if v, ok := d.GetOk("type_version_id"); ok { input.TypeVersionId = aws.String(v.(string)) } @@ -102,20 +98,20 @@ func resourceAwsCloudControlApiResourceCreate(ctx context.Context, d *schema.Res output, err := conn.CreateResourceWithContext(ctx, input) if err != nil { - return diag.FromErr(fmt.Errorf("error creating CloudFormation Resource: %w", err)) + return diag.FromErr(fmt.Errorf("error creating Cloud Control API Resource (%s): %w", typeName, err)) } if output == nil || output.ProgressEvent == nil { - return diag.FromErr(fmt.Errorf("error creating CloudFormation Resource: empty response")) + return diag.FromErr(fmt.Errorf("error creating Cloud Control API Resource (%s): empty result", typeName)) } // Always try to capture the identifier before returning errors d.SetId(aws.StringValue(output.ProgressEvent.Identifier)) - output.ProgressEvent, err = waiter.ResourceRequestStatusProgressEventOperationStatusSuccess(ctx, conn, aws.StringValue(output.ProgressEvent.RequestToken), d.Timeout(schema.TimeoutCreate)) + output.ProgressEvent, err = waiter.ProgressEventOperationStatusSuccess(ctx, conn, aws.StringValue(output.ProgressEvent.RequestToken), d.Timeout(schema.TimeoutCreate)) if err != nil { - return diag.FromErr(fmt.Errorf("error waiting for CloudForamtion Resource (%s) creation: %w", d.Id(), err)) + return diag.FromErr(fmt.Errorf("error waiting for Cloud Control API Resource (%s) create: %w", d.Id(), err)) } // Some resources do not set the identifier until after creation @@ -129,43 +125,24 @@ func resourceAwsCloudControlApiResourceCreate(ctx context.Context, d *schema.Res func resourceAwsCloudControlApiResourceRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { conn := meta.(*AWSClient).cloudcontrolapiconn - input := &cloudcontrolapi.GetResourceInput{ - Identifier: aws.String(d.Id()), - } - - if v, ok := d.GetOk("role_arn"); ok { - input.RoleArn = aws.String(v.(string)) - } - - if v, ok := d.GetOk("type_name"); ok { - input.TypeName = aws.String(v.(string)) - } - - if v, ok := d.GetOk("type_version_id"); ok { - input.TypeVersionId = aws.String(v.(string)) - } - - output, err := conn.GetResourceWithContext(ctx, input) - - if tfawserr.ErrCodeEquals(err, cloudcontrolapi.ErrCodeResourceNotFoundException) { - if d.IsNewResource() { - return diag.FromErr(fmt.Errorf("error reading CloudFormation Resource (%s): not found after creation", d.Id())) - } + resourceDescription, err := finder.ResourceByID(ctx, conn, + d.Id(), + d.Get("type_name").(string), + d.Get("type_version_id").(string), + d.Get("role_arn").(string), + ) - log.Printf("[WARN] CloudFormation Resource (%s) not found, removing from state", d.Id()) + if !d.IsNewResource() && tfresource.NotFound(err) { + log.Printf("[WARN] Cloud Control API Resource (%s) not found, removing from state", d.Id()) d.SetId("") return nil } if err != nil { - return diag.FromErr(fmt.Errorf("error reading CloudFormation Resource (%s): %w", d.Id(), err)) + return diag.FromErr(fmt.Errorf("error reading Cloud Control API Resource (%s): %w", d.Id(), err)) } - if output == nil || output.ResourceDescription == nil { - return diag.FromErr(fmt.Errorf("error reading CloudFormation Resource (%s): empty response", d.Id())) - } - - d.Set("properties", output.ResourceDescription.Properties) + d.Set("properties", resourceDescription.Properties) return nil } @@ -192,16 +169,13 @@ func resourceAwsCloudControlApiResourceUpdate(ctx context.Context, d *schema.Res ClientToken: aws.String(resource.UniqueId()), Identifier: aws.String(d.Id()), PatchDocument: aws.String(patchDocument), + TypeName: aws.String(d.Get("type_name").(string)), } if v, ok := d.GetOk("role_arn"); ok { input.RoleArn = aws.String(v.(string)) } - if v, ok := d.GetOk("type_name"); ok { - input.TypeName = aws.String(v.(string)) - } - if v, ok := d.GetOk("type_version_id"); ok { input.TypeVersionId = aws.String(v.(string)) } @@ -209,15 +183,15 @@ func resourceAwsCloudControlApiResourceUpdate(ctx context.Context, d *schema.Res output, err := conn.UpdateResourceWithContext(ctx, input) if err != nil { - return diag.FromErr(fmt.Errorf("error updating CloudFormation Resource (%s): %w", d.Id(), err)) + return diag.FromErr(fmt.Errorf("error updating Cloud Control API Resource (%s): %w", d.Id(), err)) } if output == nil || output.ProgressEvent == nil { - return diag.FromErr(fmt.Errorf("error updating CloudFormation Resource (%s): empty reponse", d.Id())) + return diag.FromErr(fmt.Errorf("error updating Cloud Control API Resource (%s): empty result", d.Id())) } - if _, err := waiter.ResourceRequestStatusProgressEventOperationStatusSuccess(ctx, conn, aws.StringValue(output.ProgressEvent.RequestToken), d.Timeout(schema.TimeoutDelete)); err != nil { - return diag.FromErr(fmt.Errorf("error waiting for CloudFormation Resource (%s) update: %w", d.Id(), err)) + if _, err := waiter.ProgressEventOperationStatusSuccess(ctx, conn, aws.StringValue(output.ProgressEvent.RequestToken), d.Timeout(schema.TimeoutUpdate)); err != nil { + return diag.FromErr(fmt.Errorf("error waiting for Cloud Control API Resource (%s) update: %w", d.Id(), err)) } } @@ -230,16 +204,13 @@ func resourceAwsCloudControlApiResourceDelete(ctx context.Context, d *schema.Res input := &cloudcontrolapi.DeleteResourceInput{ ClientToken: aws.String(resource.UniqueId()), Identifier: aws.String(d.Id()), + TypeName: aws.String(d.Get("type_name").(string)), } if v, ok := d.GetOk("role_arn"); ok { input.RoleArn = aws.String(v.(string)) } - if v, ok := d.GetOk("type_name"); ok { - input.TypeName = aws.String(v.(string)) - } - if v, ok := d.GetOk("type_version_id"); ok { input.TypeVersionId = aws.String(v.(string)) } @@ -247,21 +218,21 @@ func resourceAwsCloudControlApiResourceDelete(ctx context.Context, d *schema.Res output, err := conn.DeleteResourceWithContext(ctx, input) if err != nil { - return diag.FromErr(fmt.Errorf("error deleting CloudFormation Resource (%s): %w", d.Id(), err)) + return diag.FromErr(fmt.Errorf("error deleting Cloud Control API Resource (%s): %w", d.Id(), err)) } if output == nil || output.ProgressEvent == nil { - return diag.FromErr(fmt.Errorf("error deleting CloudFormation Resource (%s): empty response", d.Id())) + return diag.FromErr(fmt.Errorf("error deleting Cloud Control API Resource (%s): empty result", d.Id())) } - progressEvent, err := waiter.ResourceRequestStatusProgressEventOperationStatusSuccess(ctx, conn, aws.StringValue(output.ProgressEvent.RequestToken), d.Timeout(schema.TimeoutDelete)) + progressEvent, err := waiter.ProgressEventOperationStatusSuccess(ctx, conn, aws.StringValue(output.ProgressEvent.RequestToken), d.Timeout(schema.TimeoutDelete)) if progressEvent != nil && aws.StringValue(progressEvent.ErrorCode) == cloudcontrolapi.HandlerErrorCodeNotFound { return nil } if err != nil { - return diag.FromErr(fmt.Errorf("error waiting for CloudFormation Resource (%s) deletion: %w", d.Id(), err)) + return diag.FromErr(fmt.Errorf("error waiting for Cloud Control API Resource (%s) delete: %w", d.Id(), err)) } return nil @@ -271,25 +242,17 @@ func resourceAwsCloudControlApiResourceCustomizeDiffGetSchema(ctx context.Contex conn := meta.(*AWSClient).cfconn resourceSchema := diff.Get("schema").(string) - typeName := diff.Get("type_name").(string) if resourceSchema != "" { return nil } - input := &cloudformation.DescribeTypeInput{ - Type: aws.String(cloudformation.RegistryTypeResource), - TypeName: aws.String(typeName), - } + typeName := diff.Get("type_name").(string) - output, err := conn.DescribeTypeWithContext(ctx, input) + output, err := cffinder.TypeByName(ctx, conn, typeName) if err != nil { - return fmt.Errorf("error describing CloudFormation Type (%s): %w", typeName, err) - } - - if output == nil { - return fmt.Errorf("error describing CloudFormation Type (%s): empty reponse", typeName) + return fmt.Errorf("error reading CloudFormation Type (%s): %w", typeName, err) } if err := diff.SetNew("schema", output.Schema); err != nil { diff --git a/aws/resource_aws_cloudcontrolapi_resource_test.go b/aws/resource_aws_cloudcontrolapi_resource_test.go index 2446164f0c2..86c3d23372a 100644 --- a/aws/resource_aws_cloudcontrolapi_resource_test.go +++ b/aws/resource_aws_cloudcontrolapi_resource_test.go @@ -1,17 +1,18 @@ package aws import ( + "context" "fmt" "regexp" "testing" - "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudcontrolapi" "github.com/aws/aws-sdk-go/service/cloudformation" - "github.com/hashicorp/aws-sdk-go-base/tfawserr" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/cloudcontrolapi/finder" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/tfresource" ) func TestAccAwsCloudControlApiResource_basic(t *testing.T) { @@ -463,28 +464,17 @@ func testAccCheckAwsCloudControlApiResourceDestroy(s *terraform.State) error { continue } - input := &cloudcontrolapi.GetResourceInput{ - Identifier: aws.String(rs.Primary.ID), - TypeName: aws.String(rs.Primary.Attributes["type_name"]), - } - - _, err := conn.GetResource(input) - - if tfawserr.ErrCodeEquals(err, cloudcontrolapi.ErrCodeResourceNotFoundException) { - continue - } + _, err := finder.ResourceByID(context.TODO(), conn, rs.Primary.ID, rs.Primary.Attributes["type_name"], "", "") - // Temporary: Some CloudFormation Resources do not correctly re-map - // "not found" errors, instead returning a HandlerFailureException. - // These should be reported and fixed upstream over time, but for now - // work around the issue only in CheckDestroy. - if tfawserr.ErrMessageContains(err, cloudcontrolapi.ErrCodeHandlerFailureException, "not found") { + if tfresource.NotFound(err) { continue } if err != nil { - return fmt.Errorf("error reading CloudFormation Resource (%s): %w", rs.Primary.ID, err) + return err } + + return fmt.Errorf("Cloud Control API Resource %s still exists", rs.Primary.ID) } return nil From 7654f4a05dd8f6109bfafcc88cc38d8d7bf99eec Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 16 Sep 2021 14:46:47 -0400 Subject: [PATCH 21/33] r/aws_serverlessapplicationrepository_cloudformation_stack: Add 'finder.ChangeSetByStackIDAndChangeSetName'. Acceptance test output: % make testacc TESTARGS='-run=TestAccAwsServerlessApplicationRepositoryCloudFormationStack_' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAwsServerlessApplicationRepositoryCloudFormationStack_ -timeout 180m === RUN TestAccAwsServerlessApplicationRepositoryCloudFormationStack_basic === PAUSE TestAccAwsServerlessApplicationRepositoryCloudFormationStack_basic === RUN TestAccAwsServerlessApplicationRepositoryCloudFormationStack_disappears === PAUSE TestAccAwsServerlessApplicationRepositoryCloudFormationStack_disappears === RUN TestAccAwsServerlessApplicationRepositoryCloudFormationStack_versioned === PAUSE TestAccAwsServerlessApplicationRepositoryCloudFormationStack_versioned === RUN TestAccAwsServerlessApplicationRepositoryCloudFormationStack_paired === PAUSE TestAccAwsServerlessApplicationRepositoryCloudFormationStack_paired === RUN TestAccAwsServerlessApplicationRepositoryCloudFormationStack_Tags === PAUSE TestAccAwsServerlessApplicationRepositoryCloudFormationStack_Tags === RUN TestAccAwsServerlessApplicationRepositoryCloudFormationStack_update === PAUSE TestAccAwsServerlessApplicationRepositoryCloudFormationStack_update === CONT TestAccAwsServerlessApplicationRepositoryCloudFormationStack_basic === CONT TestAccAwsServerlessApplicationRepositoryCloudFormationStack_Tags === CONT TestAccAwsServerlessApplicationRepositoryCloudFormationStack_disappears === CONT TestAccAwsServerlessApplicationRepositoryCloudFormationStack_update === CONT TestAccAwsServerlessApplicationRepositoryCloudFormationStack_versioned === CONT TestAccAwsServerlessApplicationRepositoryCloudFormationStack_paired --- PASS: TestAccAwsServerlessApplicationRepositoryCloudFormationStack_disappears (105.46s) --- PASS: TestAccAwsServerlessApplicationRepositoryCloudFormationStack_paired (109.86s) --- PASS: TestAccAwsServerlessApplicationRepositoryCloudFormationStack_basic (119.13s) --- PASS: TestAccAwsServerlessApplicationRepositoryCloudFormationStack_update (228.79s) --- PASS: TestAccAwsServerlessApplicationRepositoryCloudFormationStack_Tags (260.04s) --- PASS: TestAccAwsServerlessApplicationRepositoryCloudFormationStack_versioned (264.98s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 270.926s --- .../service/cloudformation/finder/finder.go | 26 ++++++++++++++++ .../service/cloudformation/waiter/status.go | 19 ++++-------- .../service/cloudformation/waiter/waiter.go | 30 +++++++------------ ...licationrepository_cloudformation_stack.go | 2 ++ 4 files changed, 45 insertions(+), 32 deletions(-) diff --git a/aws/internal/service/cloudformation/finder/finder.go b/aws/internal/service/cloudformation/finder/finder.go index 9a0cfc6ca51..df160da41b3 100644 --- a/aws/internal/service/cloudformation/finder/finder.go +++ b/aws/internal/service/cloudformation/finder/finder.go @@ -11,6 +11,32 @@ import ( "github.com/terraform-providers/terraform-provider-aws/aws/internal/tfresource" ) +func ChangeSetByStackIDAndChangeSetName(conn *cloudformation.CloudFormation, stackID, changeSetName string) (*cloudformation.DescribeChangeSetOutput, error) { + input := &cloudformation.DescribeChangeSetInput{ + ChangeSetName: aws.String(changeSetName), + StackName: aws.String(stackID), + } + + output, err := conn.DescribeChangeSet(input) + + if tfawserr.ErrCodeEquals(err, cloudformation.ErrCodeChangeSetNotFoundException) { + return nil, &resource.NotFoundError{ + LastError: err, + LastRequest: input, + } + } + + if err != nil { + return nil, err + } + + if output == nil { + return nil, tfresource.NewEmptyResultError(input) + } + + return output, nil +} + func StackByID(conn *cloudformation.CloudFormation, id string) (*cloudformation.Stack, error) { input := &cloudformation.DescribeStacksInput{ StackName: aws.String(id), diff --git a/aws/internal/service/cloudformation/waiter/status.go b/aws/internal/service/cloudformation/waiter/status.go index 09a1efb5e00..f95d220c1c4 100644 --- a/aws/internal/service/cloudformation/waiter/status.go +++ b/aws/internal/service/cloudformation/waiter/status.go @@ -2,7 +2,6 @@ package waiter import ( "context" - "log" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudformation" @@ -13,23 +12,17 @@ import ( func ChangeSetStatus(conn *cloudformation.CloudFormation, stackID, changeSetName string) resource.StateRefreshFunc { return func() (interface{}, string, error) { - resp, err := conn.DescribeChangeSet(&cloudformation.DescribeChangeSetInput{ - ChangeSetName: aws.String(changeSetName), - StackName: aws.String(stackID), - }) - if err != nil { - log.Printf("[ERROR] Failed to describe CloudFormation change set: %s", err) - return nil, "", err - } + output, err := finder.ChangeSetByStackIDAndChangeSetName(conn, stackID, changeSetName) - if resp == nil { - log.Printf("[WARN] Describing CloudFormation change set returned no response") + if tfresource.NotFound(err) { return nil, "", nil } - status := aws.StringValue(resp.Status) + if err != nil { + return nil, "", err + } - return resp, status, err + return output, aws.StringValue(output.Status), nil } } diff --git a/aws/internal/service/cloudformation/waiter/waiter.go b/aws/internal/service/cloudformation/waiter/waiter.go index 1c0983ec5e0..a02386828e3 100644 --- a/aws/internal/service/cloudformation/waiter/waiter.go +++ b/aws/internal/service/cloudformation/waiter/waiter.go @@ -16,32 +16,28 @@ import ( ) const ( - // Maximum amount of time to wait for a Change Set to be Created ChangeSetCreatedTimeout = 5 * time.Minute ) func ChangeSetCreated(conn *cloudformation.CloudFormation, stackID, changeSetName string) (*cloudformation.DescribeChangeSetOutput, error) { stateConf := resource.StateChangeConf{ - Pending: []string{ - cloudformation.ChangeSetStatusCreatePending, - cloudformation.ChangeSetStatusCreateInProgress, - }, - Target: []string{ - cloudformation.ChangeSetStatusCreateComplete, - }, + Pending: []string{cloudformation.ChangeSetStatusCreateInProgress, cloudformation.ChangeSetStatusCreatePending}, + Target: []string{cloudformation.ChangeSetStatusCreateComplete}, Timeout: ChangeSetCreatedTimeout, Refresh: ChangeSetStatus(conn, stackID, changeSetName), } + outputRaw, err := stateConf.WaitForState() - if err != nil { - return nil, err - } - changeSet, ok := outputRaw.(*cloudformation.DescribeChangeSetOutput) - if !ok { - return nil, err + if output, ok := outputRaw.(*cloudformation.DescribeChangeSetOutput); ok { + if status := aws.StringValue(output.Status); status == cloudformation.ChangeSetStatusFailed { + tfresource.SetLastError(err, errors.New(aws.StringValue(output.StatusReason))) + } + + return output, err } - return changeSet, err + + return nil, err } const ( @@ -280,10 +276,6 @@ func TypeRegistrationProgressStatusComplete(ctx context.Context, conn *cloudform outputRaw, err := stateConf.WaitForState() if output, ok := outputRaw.(*cloudformation.DescribeTypeRegistrationOutput); ok { - if status := aws.StringValue(output.ProgressStatus); status == cloudformation.RegistrationStatusFailed { - tfresource.SetLastError(err, errors.New(aws.StringValue(output.Description))) - } - return output, err } diff --git a/aws/resource_aws_serverlessapplicationrepository_cloudformation_stack.go b/aws/resource_aws_serverlessapplicationrepository_cloudformation_stack.go index bc734e3f475..ba5bb63f007 100644 --- a/aws/resource_aws_serverlessapplicationrepository_cloudformation_stack.go +++ b/aws/resource_aws_serverlessapplicationrepository_cloudformation_stack.go @@ -130,11 +130,13 @@ func resourceAwsServerlessApplicationRepositoryCloudFormationStackRead(d *schema ignoreTagsConfig := meta.(*AWSClient).IgnoreTagsConfig stack, err := cffinder.StackByID(cfConn, d.Id()) + if tfresource.NotFound(err) { log.Printf("[WARN] Serverless Application Repository CloudFormation Stack (%s) not found, removing from state", d.Id()) d.SetId("") return nil } + if err != nil { return fmt.Errorf("error describing Serverless Application Repository CloudFormation Stack (%s): %w", d.Id(), err) } From fff543940dfdb38502b63711ffbf41210f3f1685 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 17 Sep 2021 08:00:42 -0400 Subject: [PATCH 22/33] Use 'internal/service/cloudformation/finder' for StackSet and StackInstance. Acceptance test output: % make testacc TESTARGS='-run=TestAccAWSCloudFormationStackSetInstance_\|TestAccAWSCloudFormationStackSet_' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSCloudFormationStackSetInstance_\|TestAccAWSCloudFormationStackSet_ -timeout 180m === RUN TestAccAWSCloudFormationStackSetInstance_basic === PAUSE TestAccAWSCloudFormationStackSetInstance_basic === RUN TestAccAWSCloudFormationStackSetInstance_disappears === PAUSE TestAccAWSCloudFormationStackSetInstance_disappears === RUN TestAccAWSCloudFormationStackSetInstance_disappears_StackSet === PAUSE TestAccAWSCloudFormationStackSetInstance_disappears_StackSet === RUN TestAccAWSCloudFormationStackSetInstance_ParameterOverrides === PAUSE TestAccAWSCloudFormationStackSetInstance_ParameterOverrides === RUN TestAccAWSCloudFormationStackSetInstance_RetainStack === PAUSE TestAccAWSCloudFormationStackSetInstance_RetainStack === RUN TestAccAWSCloudFormationStackSet_basic === PAUSE TestAccAWSCloudFormationStackSet_basic === RUN TestAccAWSCloudFormationStackSet_disappears === PAUSE TestAccAWSCloudFormationStackSet_disappears === RUN TestAccAWSCloudFormationStackSet_AdministrationRoleArn === PAUSE TestAccAWSCloudFormationStackSet_AdministrationRoleArn === RUN TestAccAWSCloudFormationStackSet_Description === PAUSE TestAccAWSCloudFormationStackSet_Description === RUN TestAccAWSCloudFormationStackSet_ExecutionRoleName === PAUSE TestAccAWSCloudFormationStackSet_ExecutionRoleName === RUN TestAccAWSCloudFormationStackSet_Name === PAUSE TestAccAWSCloudFormationStackSet_Name === RUN TestAccAWSCloudFormationStackSet_Parameters === PAUSE TestAccAWSCloudFormationStackSet_Parameters === RUN TestAccAWSCloudFormationStackSet_Parameters_Default provider_test.go:58: this resource does not currently ignore unconfigured CloudFormation template parameters with the Default property --- SKIP: TestAccAWSCloudFormationStackSet_Parameters_Default (0.00s) === RUN TestAccAWSCloudFormationStackSet_Parameters_NoEcho provider_test.go:58: this resource does not currently ignore CloudFormation template parameters with the NoEcho property --- SKIP: TestAccAWSCloudFormationStackSet_Parameters_NoEcho (0.00s) === RUN TestAccAWSCloudFormationStackSet_PermissionModel_ServiceManaged provider_test.go:58: API does not support enabling Organizations access (in particular, creating the Stack Sets IAM Service-Linked Role) --- SKIP: TestAccAWSCloudFormationStackSet_PermissionModel_ServiceManaged (0.00s) === RUN TestAccAWSCloudFormationStackSet_Tags === PAUSE TestAccAWSCloudFormationStackSet_Tags === RUN TestAccAWSCloudFormationStackSet_TemplateBody === PAUSE TestAccAWSCloudFormationStackSet_TemplateBody === RUN TestAccAWSCloudFormationStackSet_TemplateUrl === PAUSE TestAccAWSCloudFormationStackSet_TemplateUrl === CONT TestAccAWSCloudFormationStackSetInstance_basic === CONT TestAccAWSCloudFormationStackSet_Description === CONT TestAccAWSCloudFormationStackSetInstance_ParameterOverrides === CONT TestAccAWSCloudFormationStackSet_ExecutionRoleName === CONT TestAccAWSCloudFormationStackSetInstance_RetainStack === CONT TestAccAWSCloudFormationStackSet_basic === CONT TestAccAWSCloudFormationStackSet_Tags === CONT TestAccAWSCloudFormationStackSet_TemplateUrl === CONT TestAccAWSCloudFormationStackSet_disappears === CONT TestAccAWSCloudFormationStackSet_Name === CONT TestAccAWSCloudFormationStackSet_TemplateBody === CONT TestAccAWSCloudFormationStackSet_Parameters === CONT TestAccAWSCloudFormationStackSetInstance_disappears === CONT TestAccAWSCloudFormationStackSet_AdministrationRoleArn === CONT TestAccAWSCloudFormationStackSetInstance_disappears_StackSet --- PASS: TestAccAWSCloudFormationStackSet_disappears (34.78s) --- PASS: TestAccAWSCloudFormationStackSet_basic (42.22s) --- PASS: TestAccAWSCloudFormationStackSet_ExecutionRoleName (59.06s) --- PASS: TestAccAWSCloudFormationStackSet_Description (59.90s) --- PASS: TestAccAWSCloudFormationStackSet_Name (60.03s) --- PASS: TestAccAWSCloudFormationStackSet_TemplateBody (69.16s) --- PASS: TestAccAWSCloudFormationStackSet_AdministrationRoleArn (85.65s) --- PASS: TestAccAWSCloudFormationStackSet_TemplateUrl (90.90s) --- PASS: TestAccAWSCloudFormationStackSet_Parameters (96.95s) --- PASS: TestAccAWSCloudFormationStackSet_Tags (115.43s) --- PASS: TestAccAWSCloudFormationStackSetInstance_disappears_StackSet (131.74s) --- PASS: TestAccAWSCloudFormationStackSetInstance_basic (132.29s) --- PASS: TestAccAWSCloudFormationStackSetInstance_disappears (134.32s) --- PASS: TestAccAWSCloudFormationStackSetInstance_RetainStack (183.85s) --- PASS: TestAccAWSCloudFormationStackSetInstance_ParameterOverrides (224.28s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 228.064s --- .../service/cloudformation/finder/finder.go | 52 ++++++ aws/internal/service/cloudformation/id.go | 25 +++ .../service/cloudformation/waiter/waiter.go | 16 +- aws/resource_aws_cloudformation_stack_set.go | 57 ++----- ...e_aws_cloudformation_stack_set_instance.go | 159 +++++------------- ..._cloudformation_stack_set_instance_test.go | 158 +++++++---------- ...ource_aws_cloudformation_stack_set_test.go | 86 ++++------ 7 files changed, 240 insertions(+), 313 deletions(-) create mode 100644 aws/internal/service/cloudformation/id.go diff --git a/aws/internal/service/cloudformation/finder/finder.go b/aws/internal/service/cloudformation/finder/finder.go index df160da41b3..467aac9b3fe 100644 --- a/aws/internal/service/cloudformation/finder/finder.go +++ b/aws/internal/service/cloudformation/finder/finder.go @@ -75,6 +75,58 @@ func StackByID(conn *cloudformation.CloudFormation, id string) (*cloudformation. return stack, nil } +func StackInstanceByName(conn *cloudformation.CloudFormation, stackSetName, accountID, region string) (*cloudformation.StackInstance, error) { + input := &cloudformation.DescribeStackInstanceInput{ + StackInstanceAccount: aws.String(accountID), + StackInstanceRegion: aws.String(region), + StackSetName: aws.String(stackSetName), + } + + output, err := conn.DescribeStackInstance(input) + + if tfawserr.ErrCodeEquals(err, cloudformation.ErrCodeStackInstanceNotFoundException) || tfawserr.ErrCodeEquals(err, cloudformation.ErrCodeStackSetNotFoundException) { + return nil, &resource.NotFoundError{ + LastError: err, + LastRequest: input, + } + } + + if err != nil { + return nil, err + } + + if output == nil || output.StackInstance == nil { + return nil, tfresource.NewEmptyResultError(input) + } + + return output.StackInstance, nil +} + +func StackSetByName(conn *cloudformation.CloudFormation, name string) (*cloudformation.StackSet, error) { + input := &cloudformation.DescribeStackSetInput{ + StackSetName: aws.String(name), + } + + output, err := conn.DescribeStackSet(input) + + if tfawserr.ErrCodeEquals(err, cloudformation.ErrCodeStackSetNotFoundException) { + return nil, &resource.NotFoundError{ + LastError: err, + LastRequest: input, + } + } + + if err != nil { + return nil, err + } + + if output == nil || output.StackSet == nil { + return nil, tfresource.NewEmptyResultError(input) + } + + return output.StackSet, nil +} + func StackSetOperationByStackSetNameAndOperationID(conn *cloudformation.CloudFormation, stackSetName, operationID string) (*cloudformation.StackSetOperation, error) { input := &cloudformation.DescribeStackSetOperationInput{ OperationId: aws.String(operationID), diff --git a/aws/internal/service/cloudformation/id.go b/aws/internal/service/cloudformation/id.go new file mode 100644 index 00000000000..ad320b07bc3 --- /dev/null +++ b/aws/internal/service/cloudformation/id.go @@ -0,0 +1,25 @@ +package cloudformation + +import ( + "fmt" + "strings" +) + +const stackSetInstanceResourceIDSeparator = "," + +func StackSetInstanceCreateResourceID(stackSetName, accountID, region string) string { + parts := []string{stackSetName, accountID, region} + id := strings.Join(parts, stackSetInstanceResourceIDSeparator) + + return id +} + +func StackSetInstanceParseResourceID(id string) (string, string, string, error) { + parts := strings.Split(id, stackSetInstanceResourceIDSeparator) + + if len(parts) == 3 && parts[0] != "" && parts[1] != "" && parts[2] != "" { + return parts[0], parts[1], parts[2], nil + } + + return "", "", "", fmt.Errorf("unexpected format for ID (%[1]s), expected STACKSETNAME%[2]sACCOUNDID%[2]sREGION", id, stackSetInstanceResourceIDSeparator) +} diff --git a/aws/internal/service/cloudformation/waiter/waiter.go b/aws/internal/service/cloudformation/waiter/waiter.go index a02386828e3..3f4dc21b973 100644 --- a/aws/internal/service/cloudformation/waiter/waiter.go +++ b/aws/internal/service/cloudformation/waiter/waiter.go @@ -67,7 +67,7 @@ func StackSetOperationSucceeded(conn *cloudformation.CloudFormation, stackSetNam Delay: stackSetOperationDelay, } - outputRaw, err := stateConf.WaitForState() + outputRaw, waitErr := stateConf.WaitForState() if output, ok := outputRaw.(*cloudformation.StackSetOperation); ok { if status := aws.StringValue(output.Status); status == cloudformation.StackSetOperationStatusFailed { @@ -77,7 +77,7 @@ func StackSetOperationSucceeded(conn *cloudformation.CloudFormation, stackSetNam } var summaries []*cloudformation.StackSetOperationResultSummary - err := conn.ListStackSetOperationResultsPages(input, func(page *cloudformation.ListStackSetOperationResultsOutput, lastPage bool) bool { + listErr := conn.ListStackSetOperationResultsPages(input, func(page *cloudformation.ListStackSetOperationResultsOutput, lastPage bool) bool { if page == nil { return !lastPage } @@ -87,17 +87,17 @@ func StackSetOperationSucceeded(conn *cloudformation.CloudFormation, stackSetNam return !lastPage }) - if err != nil { - return nil, fmt.Errorf("error listing CloudFormation Stack Set (%s) Operation (%s) results: %w", stackSetName, operationID, err) + if listErr == nil { + tfresource.SetLastError(waitErr, fmt.Errorf("Operation (%s) Results: %w", operationID, tfcloudformation.StackSetOperationError(summaries))) + } else { + tfresource.SetLastError(waitErr, fmt.Errorf("error listing CloudFormation Stack Set (%s) Operation (%s) results: %w", stackSetName, operationID, listErr)) } - - tfresource.SetLastError(err, fmt.Errorf("Operation (%s) Results:\n%w", operationID, tfcloudformation.StackSetOperationError(summaries))) } - return output, err + return output, waitErr } - return nil, err + return nil, waitErr } const ( diff --git a/aws/resource_aws_cloudformation_stack_set.go b/aws/resource_aws_cloudformation_stack_set.go index 17a341050fc..2e81251f95e 100644 --- a/aws/resource_aws_cloudformation_stack_set.go +++ b/aws/resource_aws_cloudformation_stack_set.go @@ -7,11 +7,14 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudformation" + "github.com/hashicorp/aws-sdk-go-base/tfawserr" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/cloudformation/finder" "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/cloudformation/waiter" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/tfresource" ) func resourceAwsCloudFormationStackSet() *schema.Resource { @@ -132,8 +135,8 @@ func resourceAwsCloudFormationStackSetCreate(d *schema.ResourceData, meta interf conn := meta.(*AWSClient).cfconn defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig tags := defaultTagsConfig.MergeTags(keyvaluetags.New(d.Get("tags").(map[string]interface{}))) - name := d.Get("name").(string) + name := d.Get("name").(string) input := &cloudformation.CreateStackSetInput{ ClientRequestToken: aws.String(resource.UniqueId()), StackSetName: aws.String(name), @@ -183,7 +186,7 @@ func resourceAwsCloudFormationStackSetCreate(d *schema.ResourceData, meta interf _, err := conn.CreateStackSet(input) if err != nil { - return fmt.Errorf("error creating CloudFormation StackSet: %s", err) + return fmt.Errorf("error creating CloudFormation StackSet (%s): %w", name, err) } d.SetId(name) @@ -196,29 +199,18 @@ func resourceAwsCloudFormationStackSetRead(d *schema.ResourceData, meta interfac defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig ignoreTagsConfig := meta.(*AWSClient).IgnoreTagsConfig - input := &cloudformation.DescribeStackSetInput{ - StackSetName: aws.String(d.Id()), - } - - log.Printf("[DEBUG] Reading CloudFormation StackSet: %s", d.Id()) - output, err := conn.DescribeStackSet(input) + stackSet, err := finder.StackSetByName(conn, d.Id()) - if isAWSErr(err, cloudformation.ErrCodeStackSetNotFoundException, "") { + if !d.IsNewResource() && tfresource.NotFound(err) { log.Printf("[WARN] CloudFormation StackSet (%s) not found, removing from state", d.Id()) d.SetId("") return nil } if err != nil { - return fmt.Errorf("error reading CloudFormation StackSet (%s): %s", d.Id(), err) + return fmt.Errorf("error reading CloudFormation StackSet (%s): %w", d.Id(), err) } - if output == nil || output.StackSet == nil { - return fmt.Errorf("error reading CloudFormation StackSet (%s): empty response", d.Id()) - } - - stackSet := output.StackSet - d.Set("administration_role_arn", stackSet.AdministrationRoleARN) d.Set("arn", stackSet.StackSetARN) @@ -317,11 +309,11 @@ func resourceAwsCloudFormationStackSetUpdate(d *schema.ResourceData, meta interf output, err := conn.UpdateStackSet(input) if err != nil { - return fmt.Errorf("error updating CloudFormation StackSet (%s): %s", d.Id(), err) + return fmt.Errorf("error updating CloudFormation StackSet (%s): %w", d.Id(), err) } if _, err := waiter.StackSetOperationSucceeded(conn, d.Id(), aws.StringValue(output.OperationId), d.Timeout(schema.TimeoutUpdate)); err != nil { - return fmt.Errorf("error waiting for CloudFormation StackSet (%s) update: %s", d.Id(), err) + return fmt.Errorf("error waiting for CloudFormation StackSet (%s) update: %w", d.Id(), err) } return resourceAwsCloudFormationStackSetRead(d, meta) @@ -337,42 +329,17 @@ func resourceAwsCloudFormationStackSetDelete(d *schema.ResourceData, meta interf log.Printf("[DEBUG] Deleting CloudFormation StackSet: %s", d.Id()) _, err := conn.DeleteStackSet(input) - if isAWSErr(err, cloudformation.ErrCodeStackSetNotFoundException, "") { + if tfawserr.ErrCodeEquals(err, cloudformation.ErrCodeStackSetNotFoundException) { return nil } if err != nil { - return fmt.Errorf("error deleting CloudFormation StackSet (%s): %s", d.Id(), err) + return fmt.Errorf("error deleting CloudFormation StackSet (%s): %w", d.Id(), err) } return nil } -func listCloudFormationStackSets(conn *cloudformation.CloudFormation) ([]*cloudformation.StackSetSummary, error) { - input := &cloudformation.ListStackSetsInput{ - Status: aws.String(cloudformation.StackSetStatusActive), - } - result := make([]*cloudformation.StackSetSummary, 0) - - for { - output, err := conn.ListStackSets(input) - - if err != nil { - return result, err - } - - result = append(result, output.Summaries...) - - if aws.StringValue(output.NextToken) == "" { - break - } - - input.NextToken = output.NextToken - } - - return result, nil -} - func expandAutoDeployment(l []interface{}) *cloudformation.AutoDeployment { if len(l) == 0 { return nil diff --git a/aws/resource_aws_cloudformation_stack_set_instance.go b/aws/resource_aws_cloudformation_stack_set_instance.go index 7f82339d8e3..b094b472953 100644 --- a/aws/resource_aws_cloudformation_stack_set_instance.go +++ b/aws/resource_aws_cloudformation_stack_set_instance.go @@ -7,11 +7,15 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudformation" + "github.com/hashicorp/aws-sdk-go-base/tfawserr" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + tfcloudformation "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/cloudformation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/cloudformation/finder" "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/cloudformation/waiter" iamwaiter "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/iam/waiter" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/tfresource" ) func resourceAwsCloudFormationStackSetInstance() *schema.Resource { @@ -83,10 +87,8 @@ func resourceAwsCloudFormationStackSetInstanceCreate(d *schema.ResourceData, met } stackSetName := d.Get("stack_set_name").(string) - input := &cloudformation.CreateStackInstancesInput{ Accounts: aws.StringSlice([]string{accountID}), - OperationId: aws.String(resource.UniqueId()), Regions: aws.StringSlice([]string{region}), StackSetName: aws.String(stackSetName), } @@ -96,73 +98,59 @@ func resourceAwsCloudFormationStackSetInstanceCreate(d *schema.ResourceData, met } log.Printf("[DEBUG] Creating CloudFormation StackSet Instance: %s", input) - err := resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError { - output, err := conn.CreateStackInstances(input) + _, err := tfresource.RetryWhen( + iamwaiter.PropagationTimeout, + func() (interface{}, error) { + input.OperationId = aws.String(resource.UniqueId()) - if err != nil { - return resource.NonRetryableError(fmt.Errorf("error creating CloudFormation StackSet Instance: %w", err)) - } + output, err := conn.CreateStackInstances(input) - d.SetId(fmt.Sprintf("%s,%s,%s", stackSetName, accountID, region)) + if err != nil { + return nil, fmt.Errorf("error creating CloudFormation StackSet (%s) Instance: %w", stackSetName, err) + } - _, err = waiter.StackSetOperationSucceeded(conn, stackSetName, aws.StringValue(output.OperationId), d.Timeout(schema.TimeoutCreate)) + d.SetId(tfcloudformation.StackSetInstanceCreateResourceID(stackSetName, accountID, region)) + + return waiter.StackSetOperationSucceeded(conn, stackSetName, aws.StringValue(output.OperationId), d.Timeout(schema.TimeoutCreate)) + }, + func(err error) (bool, error) { + if err == nil { + return false, nil + } + + message := err.Error() - if err != nil { // IAM eventual consistency - if strings.Contains(err.Error(), "AccountGate check failed") { - input.OperationId = aws.String(resource.UniqueId()) - return resource.RetryableError(err) + if strings.Contains(message, "AccountGate check failed") { + return true, err } // IAM eventual consistency // User: XXX is not authorized to perform: cloudformation:CreateStack on resource: YYY - if strings.Contains(err.Error(), "is not authorized") { - input.OperationId = aws.String(resource.UniqueId()) - return resource.RetryableError(err) + if strings.Contains(message, "is not authorized") { + return true, err } // IAM eventual consistency // XXX role has insufficient YYY permissions - if strings.Contains(err.Error(), "role has insufficient") { - input.OperationId = aws.String(resource.UniqueId()) - return resource.RetryableError(err) + if strings.Contains(message, "role has insufficient") { + return true, err } // IAM eventual consistency // Account XXX should have YYY role with trust relationship to Role ZZZ - if strings.Contains(err.Error(), "role with trust relationship") { - input.OperationId = aws.String(resource.UniqueId()) - return resource.RetryableError(err) + if strings.Contains(message, "role with trust relationship") { + return true, err } // IAM eventual consistency - if strings.Contains(err.Error(), "The security token included in the request is invalid") { - input.OperationId = aws.String(resource.UniqueId()) - return resource.RetryableError(err) + if strings.Contains(message, "The security token included in the request is invalid") { + return true, err } - return resource.NonRetryableError(fmt.Errorf("error waiting for CloudFormation StackSet Instance (%s) creation: %w", d.Id(), err)) - } - - return nil - }) - - if isResourceTimeoutError(err) { - var output *cloudformation.CreateStackInstancesOutput - output, err = conn.CreateStackInstances(input) - - if err != nil { - return fmt.Errorf("error creating CloudFormation StackSet Instance: %w", err) - } - - d.SetId(fmt.Sprintf("%s,%s,%s", stackSetName, accountID, region)) - - _, err = waiter.StackSetOperationSucceeded(conn, stackSetName, aws.StringValue(output.OperationId), d.Timeout(schema.TimeoutCreate)) - - if err != nil { - return fmt.Errorf("error waiting for CloudFormation StackSet Instance (%s) creation: %w", d.Id(), err) - } - } + return false, fmt.Errorf("error waiting for CloudFormation StackSet Instance (%s) creation: %w", d.Id(), err) + }, + ) if err != nil { return err @@ -174,47 +162,28 @@ func resourceAwsCloudFormationStackSetInstanceCreate(d *schema.ResourceData, met func resourceAwsCloudFormationStackSetInstanceRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).cfconn - stackSetName, accountID, region, err := resourceAwsCloudFormationStackSetInstanceParseId(d.Id()) + stackSetName, accountID, region, err := tfcloudformation.StackSetInstanceParseResourceID(d.Id()) if err != nil { return err } - input := &cloudformation.DescribeStackInstanceInput{ - StackInstanceAccount: aws.String(accountID), - StackInstanceRegion: aws.String(region), - StackSetName: aws.String(stackSetName), - } + stackInstance, err := finder.StackInstanceByName(conn, stackSetName, accountID, region) - log.Printf("[DEBUG] Reading CloudFormation StackSet Instance: %s", d.Id()) - output, err := conn.DescribeStackInstance(input) - - if isAWSErr(err, cloudformation.ErrCodeStackInstanceNotFoundException, "") { + if !d.IsNewResource() && tfresource.NotFound(err) { log.Printf("[WARN] CloudFormation StackSet Instance (%s) not found, removing from state", d.Id()) d.SetId("") return nil } - if isAWSErr(err, cloudformation.ErrCodeStackSetNotFoundException, "") { - log.Printf("[WARN] CloudFormation StackSet (%s) not found, removing from state", d.Id()) - d.SetId("") - return nil - } - if err != nil { - return fmt.Errorf("error reading CloudFormation StackSet Instance (%s): %s", d.Id(), err) - } - - if output == nil || output.StackInstance == nil { - return fmt.Errorf("error reading CloudFormation StackSet Instance (%s): empty response", d.Id()) + return fmt.Errorf("error reading CloudFormation StackSet Instance (%s): %w", d.Id(), err) } - stackInstance := output.StackInstance - d.Set("account_id", stackInstance.Account) if err := d.Set("parameter_overrides", flattenAllCloudFormationParameters(stackInstance.ParameterOverrides)); err != nil { - return fmt.Errorf("error setting parameters: %s", err) + return fmt.Errorf("error setting parameters: %w", err) } d.Set("region", stackInstance.Region) @@ -228,7 +197,7 @@ func resourceAwsCloudFormationStackSetInstanceUpdate(d *schema.ResourceData, met conn := meta.(*AWSClient).cfconn if d.HasChange("parameter_overrides") { - stackSetName, accountID, region, err := resourceAwsCloudFormationStackSetInstanceParseId(d.Id()) + stackSetName, accountID, region, err := tfcloudformation.StackSetInstanceParseResourceID(d.Id()) if err != nil { return err @@ -250,7 +219,7 @@ func resourceAwsCloudFormationStackSetInstanceUpdate(d *schema.ResourceData, met output, err := conn.UpdateStackInstances(input) if err != nil { - return fmt.Errorf("error updating CloudFormation StackSet Instance (%s): %s", d.Id(), err) + return fmt.Errorf("error updating CloudFormation StackSet Instance (%s): %w", d.Id(), err) } if _, err := waiter.StackSetOperationSucceeded(conn, stackSetName, aws.StringValue(output.OperationId), d.Timeout(schema.TimeoutUpdate)); err != nil { @@ -264,7 +233,7 @@ func resourceAwsCloudFormationStackSetInstanceUpdate(d *schema.ResourceData, met func resourceAwsCloudFormationStackSetInstanceDelete(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).cfconn - stackSetName, accountID, region, err := resourceAwsCloudFormationStackSetInstanceParseId(d.Id()) + stackSetName, accountID, region, err := tfcloudformation.StackSetInstanceParseResourceID(d.Id()) if err != nil { return err @@ -281,11 +250,7 @@ func resourceAwsCloudFormationStackSetInstanceDelete(d *schema.ResourceData, met log.Printf("[DEBUG] Deleting CloudFormation StackSet Instance: %s", d.Id()) output, err := conn.DeleteStackInstances(input) - if isAWSErr(err, cloudformation.ErrCodeStackInstanceNotFoundException, "") { - return nil - } - - if isAWSErr(err, cloudformation.ErrCodeStackSetNotFoundException, "") { + if tfawserr.ErrCodeEquals(err, cloudformation.ErrCodeStackInstanceNotFoundException) || tfawserr.ErrCodeEquals(err, cloudformation.ErrCodeStackSetNotFoundException) { return nil } @@ -299,39 +264,3 @@ func resourceAwsCloudFormationStackSetInstanceDelete(d *schema.ResourceData, met return nil } - -func resourceAwsCloudFormationStackSetInstanceParseId(id string) (string, string, string, error) { - idFormatErr := fmt.Errorf("unexpected format of ID (%s), expected NAME,ACCOUNT,REGION", id) - - parts := strings.SplitN(id, ",", 3) - if len(parts) != 3 || parts[0] == "" || parts[1] == "" || parts[2] == "" { - return "", "", "", idFormatErr - } - - return parts[0], parts[1], parts[2], nil -} - -func listCloudFormationStackSetInstances(conn *cloudformation.CloudFormation, stackSetName string) ([]*cloudformation.StackInstanceSummary, error) { - input := &cloudformation.ListStackInstancesInput{ - StackSetName: aws.String(stackSetName), - } - result := make([]*cloudformation.StackInstanceSummary, 0) - - for { - output, err := conn.ListStackInstances(input) - - if err != nil { - return result, err - } - - result = append(result, output.Summaries...) - - if aws.StringValue(output.NextToken) == "" { - break - } - - input.NextToken = output.NextToken - } - - return result, nil -} diff --git a/aws/resource_aws_cloudformation_stack_set_instance_test.go b/aws/resource_aws_cloudformation_stack_set_instance_test.go index 6d6c1923f39..3ea06a89392 100644 --- a/aws/resource_aws_cloudformation_stack_set_instance_test.go +++ b/aws/resource_aws_cloudformation_stack_set_instance_test.go @@ -7,11 +7,13 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudformation" - "github.com/hashicorp/go-multierror" + multierror "github.com/hashicorp/go-multierror" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/cloudformation/waiter" + tfcloudformation "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/cloudformation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/cloudformation/finder" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/tfresource" ) func init() { @@ -23,75 +25,72 @@ func init() { func testSweepCloudformationStackSetInstances(region string) error { client, err := sharedClientForRegion(region) - if err != nil { - return fmt.Errorf("error getting client: %w", err) + return fmt.Errorf("error getting client: %s", err) } - conn := client.(*AWSClient).cfconn - stackSets, err := listCloudFormationStackSets(conn) - - if testSweepSkipSweepError(err) || isAWSErr(err, "ValidationError", "AWS CloudFormation StackSets is not supported") { - log.Printf("[WARN] Skipping CloudFormation StackSet Instance sweep for %s: %s", region, err) - return nil - } - - if err != nil { - return fmt.Errorf("error listing CloudFormation StackSets: %w", err) + input := &cloudformation.ListStackSetsInput{ + Status: aws.String(cloudformation.StackSetStatusActive), } - var sweeperErrs *multierror.Error + sweepResources := make([]*testSweepResource, 0) - for _, stackSet := range stackSets { - stackSetName := aws.StringValue(stackSet.StackSetName) - instances, err := listCloudFormationStackSetInstances(conn, stackSetName) - - if err != nil { - sweeperErr := fmt.Errorf("error listing CloudFormation StackSet (%s) Instances: %w", stackSetName, err) - log.Printf("[ERROR] %s", sweeperErr) - sweeperErrs = multierror.Append(sweeperErrs, sweeperErr) - continue + err = conn.ListStackSetsPages(input, func(page *cloudformation.ListStackSetsOutput, lastPage bool) bool { + if page == nil { + return !lastPage } - for _, instance := range instances { - accountID := aws.StringValue(instance.Account) - region := aws.StringValue(instance.Region) - id := fmt.Sprintf("%s / %s / %s", stackSetName, accountID, region) - - input := &cloudformation.DeleteStackInstancesInput{ - Accounts: aws.StringSlice([]string{accountID}), - OperationId: aws.String(resource.UniqueId()), - Regions: aws.StringSlice([]string{region}), - RetainStacks: aws.Bool(false), - StackSetName: aws.String(stackSetName), + for _, summary := range page.Summaries { + input := &cloudformation.ListStackInstancesInput{ + StackSetName: summary.StackSetName, } - log.Printf("[INFO] Deleting CloudFormation StackSet Instance: %s", id) - output, err := conn.DeleteStackInstances(input) + err = conn.ListStackInstancesPages(input, func(page *cloudformation.ListStackInstancesOutput, lastPage bool) bool { + if page == nil { + return !lastPage + } - if isAWSErr(err, cloudformation.ErrCodeStackInstanceNotFoundException, "") { - continue - } + for _, summary := range page.Summaries { + r := resourceAwsCloudFormationStackSetInstance() + d := r.Data(nil) + id := tfcloudformation.StackSetInstanceCreateResourceID( + aws.StringValue(summary.StackSetId), + aws.StringValue(summary.Account), + aws.StringValue(summary.Region), + ) + d.SetId(id) - if isAWSErr(err, cloudformation.ErrCodeStackSetNotFoundException, "") { - continue - } + sweepResources = append(sweepResources, NewTestSweepResource(r, d, client)) + } - if err != nil { - sweeperErr := fmt.Errorf("error deleting CloudFormation StackSet Instance (%s): %w", id, err) - log.Printf("[ERROR] %s", sweeperErr) - sweeperErrs = multierror.Append(sweeperErrs, sweeperErr) + return !lastPage + }) + + if testSweepSkipSweepError(err) { continue } - if _, err := waiter.StackSetOperationSucceeded(conn, stackSetName, aws.StringValue(output.OperationId), waiter.StackSetInstanceDeletedDefaultTimeout); err != nil { - sweeperErr := fmt.Errorf("error waiting for CloudFormation StackSet Instance (%s) deletion: %w", id, err) - log.Printf("[ERROR] %s", sweeperErr) - sweeperErrs = multierror.Append(sweeperErrs, sweeperErr) - continue + if err != nil { + sweeperErrs = multierror.Append(sweeperErrs, fmt.Errorf("error listing CloudFormation StackSet Instances (%s): %w", region, err)) } } + return !lastPage + }) + + if testSweepSkipSweepError(err) { + log.Printf("[WARN] Skipping CloudFormation StackSet Instance sweep for %s: %s", region, err) + return nil + } + + if err != nil { + return fmt.Errorf("error listing CloudFormation StackSets (%s): %w", region, err) + } + + err = testSweepResourceOrchestrator(sweepResources) + + if err != nil { + sweeperErrs = multierror.Append(sweeperErrs, fmt.Errorf("error sweeping CloudFormation StackSet Instances (%s): %w", region, err)) } return sweeperErrs.ErrorOrNil() @@ -301,63 +300,44 @@ func TestAccAWSCloudFormationStackSetInstance_RetainStack(t *testing.T) { }) } -func testAccCheckCloudFormationStackSetInstanceExists(resourceName string, stackInstance *cloudformation.StackInstance) resource.TestCheckFunc { +func testAccCheckCloudFormationStackSetInstanceExists(resourceName string, v *cloudformation.StackInstance) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[resourceName] - if !ok { return fmt.Errorf("Not found: %s", resourceName) } conn := testAccProvider.Meta().(*AWSClient).cfconn - stackSetName, accountID, region, err := resourceAwsCloudFormationStackSetInstanceParseId(rs.Primary.ID) + stackSetName, accountID, region, err := tfcloudformation.StackSetInstanceParseResourceID(rs.Primary.ID) if err != nil { return err } - input := &cloudformation.DescribeStackInstanceInput{ - StackInstanceAccount: aws.String(accountID), - StackInstanceRegion: aws.String(region), - StackSetName: aws.String(stackSetName), - } - - output, err := conn.DescribeStackInstance(input) + output, err := finder.StackInstanceByName(conn, stackSetName, accountID, region) if err != nil { return err } - if output == nil || output.StackInstance == nil { - return fmt.Errorf("CloudFormation StackSet Instance (%s) not found", rs.Primary.ID) - } - - *stackInstance = *output.StackInstance + *v = *output return nil } } -func testAccCheckCloudFormationStackSetInstanceStackExists(stackInstance *cloudformation.StackInstance, stack *cloudformation.Stack) resource.TestCheckFunc { +func testAccCheckCloudFormationStackSetInstanceStackExists(stackInstance *cloudformation.StackInstance, v *cloudformation.Stack) resource.TestCheckFunc { return func(s *terraform.State) error { conn := testAccProvider.Meta().(*AWSClient).cfconn - input := &cloudformation.DescribeStacksInput{ - StackName: stackInstance.StackId, - } - - output, err := conn.DescribeStacks(input) + output, err := finder.StackByID(conn, aws.StringValue(stackInstance.StackId)) if err != nil { return err } - if len(output.Stacks) == 0 || output.Stacks[0] == nil { - return fmt.Errorf("CloudFormation Stack (%s) not found", aws.StringValue(stackInstance.StackId)) - } - - *stack = *output.Stacks[0] + *v = *output return nil } @@ -371,35 +351,23 @@ func testAccCheckAWSCloudFormationStackSetInstanceDestroy(s *terraform.State) er continue } - stackSetName, accountID, region, err := resourceAwsCloudFormationStackSetInstanceParseId(rs.Primary.ID) + stackSetName, accountID, region, err := tfcloudformation.StackSetInstanceParseResourceID(rs.Primary.ID) if err != nil { return err } - input := &cloudformation.DescribeStackInstanceInput{ - StackInstanceAccount: aws.String(accountID), - StackInstanceRegion: aws.String(region), - StackSetName: aws.String(stackSetName), - } + _, err = finder.StackInstanceByName(conn, stackSetName, accountID, region) - output, err := conn.DescribeStackInstance(input) - - if isAWSErr(err, cloudformation.ErrCodeStackInstanceNotFoundException, "") { - return nil - } - - if isAWSErr(err, cloudformation.ErrCodeStackSetNotFoundException, "") { - return nil + if tfresource.NotFound(err) { + continue } if err != nil { return err } - if output != nil && output.StackInstance != nil { - return fmt.Errorf("CloudFormation StackSet Instance (%s) still exists", rs.Primary.ID) - } + return fmt.Errorf("CloudFormation StackSet Instance %s still exists", rs.Primary.ID) } return nil diff --git a/aws/resource_aws_cloudformation_stack_set_test.go b/aws/resource_aws_cloudformation_stack_set_test.go index e3c612cffc5..28db7f2cbd3 100644 --- a/aws/resource_aws_cloudformation_stack_set_test.go +++ b/aws/resource_aws_cloudformation_stack_set_test.go @@ -8,10 +8,11 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudformation" - "github.com/hashicorp/go-multierror" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/cloudformation/finder" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/tfresource" ) func init() { @@ -26,47 +27,47 @@ func init() { func testSweepCloudformationStackSets(region string) error { client, err := sharedClientForRegion(region) - if err != nil { - return fmt.Errorf("error getting client: %w", err) + return fmt.Errorf("error getting client: %s", err) } - conn := client.(*AWSClient).cfconn - stackSets, err := listCloudFormationStackSets(conn) + input := &cloudformation.ListStackSetsInput{ + Status: aws.String(cloudformation.StackSetStatusActive), + } + sweepResources := make([]*testSweepResource, 0) + + err = conn.ListStackSetsPages(input, func(page *cloudformation.ListStackSetsOutput, lastPage bool) bool { + if page == nil { + return !lastPage + } + + for _, summary := range page.Summaries { + r := resourceAwsCloudFormationStackSet() + d := r.Data(nil) + d.SetId(aws.StringValue(summary.StackSetName)) + + sweepResources = append(sweepResources, NewTestSweepResource(r, d, client)) + } - if testSweepSkipSweepError(err) || isAWSErr(err, "ValidationError", "AWS CloudFormation StackSets is not supported") { + return !lastPage + }) + + if testSweepSkipSweepError(err) { log.Printf("[WARN] Skipping CloudFormation StackSet sweep for %s: %s", region, err) return nil } if err != nil { - return fmt.Errorf("error listing CloudFormation StackSets: %w", err) + return fmt.Errorf("error listing CloudFormation StackSets (%s): %w", region, err) } - var sweeperErrs *multierror.Error - - for _, stackSet := range stackSets { - input := &cloudformation.DeleteStackSetInput{ - StackSetName: stackSet.StackSetName, - } - name := aws.StringValue(stackSet.StackSetName) - - log.Printf("[INFO] Deleting CloudFormation StackSet: %s", name) - _, err := conn.DeleteStackSet(input) - - if isAWSErr(err, cloudformation.ErrCodeStackSetNotFoundException, "") { - continue - } + err = testSweepResourceOrchestrator(sweepResources) - if err != nil { - sweeperErr := fmt.Errorf("error deleting CloudFormation StackSet (%s): %w", name, err) - log.Printf("[ERROR] %s", sweeperErr) - sweeperErrs = multierror.Append(sweeperErrs, sweeperErr) - continue - } + if err != nil { + return fmt.Errorf("error sweeping CloudFormation StackSets (%s): %w", region, err) } - return sweeperErrs.ErrorOrNil() + return nil } func TestAccAWSCloudFormationStackSet_basic(t *testing.T) { @@ -632,31 +633,22 @@ func TestAccAWSCloudFormationStackSet_TemplateUrl(t *testing.T) { }) } -func testAccCheckCloudFormationStackSetExists(resourceName string, stackSet *cloudformation.StackSet) resource.TestCheckFunc { +func testAccCheckCloudFormationStackSetExists(resourceName string, v *cloudformation.StackSet) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[resourceName] - if !ok { return fmt.Errorf("Not found: %s", resourceName) } conn := testAccProvider.Meta().(*AWSClient).cfconn - input := &cloudformation.DescribeStackSetInput{ - StackSetName: aws.String(rs.Primary.ID), - } - - output, err := conn.DescribeStackSet(input) + output, err := finder.StackSetByName(conn, rs.Primary.ID) if err != nil { return err } - if output == nil || output.StackSet == nil { - return fmt.Errorf("CloudFormation StackSet (%s) not found", rs.Primary.ID) - } - - *stackSet = *output.StackSet + *v = *output return nil } @@ -670,23 +662,17 @@ func testAccCheckAWSCloudFormationStackSetDestroy(s *terraform.State) error { continue } - input := cloudformation.DescribeStackSetInput{ - StackSetName: aws.String(rs.Primary.ID), - } + _, err := finder.StackSetByName(conn, rs.Primary.ID) - output, err := conn.DescribeStackSet(&input) - - if isAWSErr(err, cloudformation.ErrCodeStackSetNotFoundException, "") { - return nil + if tfresource.NotFound(err) { + continue } if err != nil { return err } - if output != nil && output.StackSet != nil { - return fmt.Errorf("CloudFormation StackSet (%s) still exists", rs.Primary.ID) - } + return fmt.Errorf("CloudFormation StackSet %s still exists", rs.Primary.ID) } return nil From 5398cb109887c8fa926fc69207a50e83e6e77349 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 17 Sep 2021 08:48:23 -0400 Subject: [PATCH 23/33] Run 'GOPRIVATE=github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go go get github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go@v0.10.0'. --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index cebc1eeb813..4fb4b41d1fa 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/beevik/etree v1.1.0 github.com/evanphx/json-patch v0.5.2 // indirect github.com/fatih/color v1.9.0 // indirect - github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.9.0 + github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.10.0 github.com/hashicorp/aws-sdk-go-base v1.0.0 github.com/hashicorp/go-cleanhttp v0.5.2 github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 diff --git a/go.sum b/go.sum index f2fb72557be..3c60cc96fa2 100644 --- a/go.sum +++ b/go.sum @@ -164,6 +164,8 @@ github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.9.0 h1:tmfUGbj6/nQxYZJWmUoY0NoGMLZBgDcyl+OlH9+vbcE= github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.9.0/go.mod h1:C6GVuO9RWOrt6QCGTmLCOYuSHpkfQSBDuRqTteOlo0g= +github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.10.0 h1:cClHI47voDkTrM7TpbXL0cTZBAseI0/1+j8pZ1sEzjA= +github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.10.0/go.mod h1:C6GVuO9RWOrt6QCGTmLCOYuSHpkfQSBDuRqTteOlo0g= github.com/hashicorp/aws-sdk-go-base v0.7.1 h1:7s/aR3hFn74tYPVihzDyZe7y/+BorN70rr9ZvpV3j3o= github.com/hashicorp/aws-sdk-go-base v0.7.1/go.mod h1:2fRjWDv3jJBeN6mVWFHV6hFTNeFBx2gpDLQaZNxUVAY= github.com/hashicorp/aws-sdk-go-private v1.40.42-0.20210915192203-499245543dfd h1:F8kyugZaV1xu7PWOqezDdeVNZxL2pG9KhGTOxnXyjzE= From cebc3d7d0576945a0a3605c5dad77c3f43f52d14 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 17 Sep 2021 08:52:48 -0400 Subject: [PATCH 24/33] r/aws_cloudcontrolapi_resource: Sanitize the CloudFormation type schema. --- aws/resource_aws_cloudcontrolapi_resource.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/resource_aws_cloudcontrolapi_resource.go b/aws/resource_aws_cloudcontrolapi_resource.go index 7c3ab456311..418dfc28a9c 100644 --- a/aws/resource_aws_cloudcontrolapi_resource.go +++ b/aws/resource_aws_cloudcontrolapi_resource.go @@ -255,7 +255,7 @@ func resourceAwsCloudControlApiResourceCustomizeDiffGetSchema(ctx context.Contex return fmt.Errorf("error reading CloudFormation Type (%s): %w", typeName, err) } - if err := diff.SetNew("schema", output.Schema); err != nil { + if err := diff.SetNew("schema", cfschema.Sanitize(aws.StringValue(output.Schema))); err != nil { return fmt.Errorf("error setting schema diff: %w", err) } From e4b6e36ed571c498276be76843a7d310d84fda3f Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Sat, 18 Sep 2021 16:53:15 -0400 Subject: [PATCH 25/33] Santitize the schema by rewriting all 'pattern' regexes to the empty string. --- aws/resource_aws_cloudcontrolapi_resource_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aws/resource_aws_cloudcontrolapi_resource_test.go b/aws/resource_aws_cloudcontrolapi_resource_test.go index 86c3d23372a..7d97fff5bc9 100644 --- a/aws/resource_aws_cloudcontrolapi_resource_test.go +++ b/aws/resource_aws_cloudcontrolapi_resource_test.go @@ -643,7 +643,8 @@ data "aws_cloudformation_type" "test" { } resource "aws_cloudcontrolapi_resource" "test" { - schema = data.aws_cloudformation_type.test.schema + # Santitize the schema by rewriting all "pattern" regexes to the empty string. + schema = replace(data.aws_cloudformation_type.test.schema, "/(?m)^(\\s+\"pattern\"\\s*:\\s*)\".*\"/", "$1\"\"") type_name = data.aws_cloudformation_type.test.type_name desired_state = jsonencode({ From 4c215139be1ca94554d2b175b9a2a963377a1d6a Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Mon, 20 Sep 2021 08:11:02 -0400 Subject: [PATCH 26/33] Revert "Santitize the schema by rewriting all 'pattern' regexes to the empty string." This reverts commit 72693b9d27c28fdded744b6e8d422a920443857c. --- aws/resource_aws_cloudcontrolapi_resource_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/aws/resource_aws_cloudcontrolapi_resource_test.go b/aws/resource_aws_cloudcontrolapi_resource_test.go index 7d97fff5bc9..86c3d23372a 100644 --- a/aws/resource_aws_cloudcontrolapi_resource_test.go +++ b/aws/resource_aws_cloudcontrolapi_resource_test.go @@ -643,8 +643,7 @@ data "aws_cloudformation_type" "test" { } resource "aws_cloudcontrolapi_resource" "test" { - # Santitize the schema by rewriting all "pattern" regexes to the empty string. - schema = replace(data.aws_cloudformation_type.test.schema, "/(?m)^(\\s+\"pattern\"\\s*:\\s*)\".*\"/", "$1\"\"") + schema = data.aws_cloudformation_type.test.schema type_name = data.aws_cloudformation_type.test.type_name desired_state = jsonencode({ From b64906ff9b5f22b4f8ea5bf565c03df6bcdc89ae Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Mon, 20 Sep 2021 08:13:23 -0400 Subject: [PATCH 27/33] Revert "r/aws_cloudcontrolapi_resource: Sanitize the CloudFormation type schema." This reverts commit 4236af145b664d43b75d8a8c7c0e7cad2fbe82cf. --- aws/resource_aws_cloudcontrolapi_resource.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/resource_aws_cloudcontrolapi_resource.go b/aws/resource_aws_cloudcontrolapi_resource.go index 418dfc28a9c..7c3ab456311 100644 --- a/aws/resource_aws_cloudcontrolapi_resource.go +++ b/aws/resource_aws_cloudcontrolapi_resource.go @@ -255,7 +255,7 @@ func resourceAwsCloudControlApiResourceCustomizeDiffGetSchema(ctx context.Contex return fmt.Errorf("error reading CloudFormation Type (%s): %w", typeName, err) } - if err := diff.SetNew("schema", cfschema.Sanitize(aws.StringValue(output.Schema))); err != nil { + if err := diff.SetNew("schema", output.Schema); err != nil { return fmt.Errorf("error setting schema diff: %w", err) } From c8e28ad5233e029d5ba46d1c6e3bdf84e8932b4d Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Mon, 20 Sep 2021 08:19:49 -0400 Subject: [PATCH 28/33] r/aws_cloudcontrolapi_resource: Don't persist the sanitized schema in state. Acceptance test output: % make testacc TESTARGS='-run=TestAccAwsCloudControlApiResource_ResourceSchema' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAwsCloudControlApiResource_ResourceSchema -timeout 180m === RUN TestAccAwsCloudControlApiResource_ResourceSchema === PAUSE TestAccAwsCloudControlApiResource_ResourceSchema === CONT TestAccAwsCloudControlApiResource_ResourceSchema --- PASS: TestAccAwsCloudControlApiResource_ResourceSchema (22.81s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 25.978s --- aws/resource_aws_cloudcontrolapi_resource.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/resource_aws_cloudcontrolapi_resource.go b/aws/resource_aws_cloudcontrolapi_resource.go index 7c3ab456311..9508b5ab450 100644 --- a/aws/resource_aws_cloudcontrolapi_resource.go +++ b/aws/resource_aws_cloudcontrolapi_resource.go @@ -277,7 +277,7 @@ func resourceAwsCloudControlApiResourceCustomizeDiffSchemaDiff(ctx context.Conte return nil } - cfResourceSchema, err := cfschema.NewResourceJsonSchemaDocument(newSchema) + cfResourceSchema, err := cfschema.NewResourceJsonSchemaDocument(cfschema.Sanitize(newSchema)) if err != nil { return fmt.Errorf("error parsing CloudFormation Resource Schema JSON: %w", err) From 39c11e4a99b38d0d7f4f914f45c9860c5b7ee58b Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Mon, 20 Sep 2021 08:33:39 -0400 Subject: [PATCH 29/33] r/aws_cloudcontrolapi_resource: Change error message for 'TestAccAwsCloudControlApiResource_DesiredState_InvalidPropertyValue' as validation of properties is now done server-side. Acceptance test output: % make testacc TESTARGS='-run=TestAccAwsCloudControlApiResource_DesiredState_InvalidPropertyValue' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAwsCloudControlApiResource_DesiredState_InvalidPropertyValue -timeout 180m === RUN TestAccAwsCloudControlApiResource_DesiredState_InvalidPropertyValue === PAUSE TestAccAwsCloudControlApiResource_DesiredState_InvalidPropertyValue === CONT TestAccAwsCloudControlApiResource_DesiredState_InvalidPropertyValue --- PASS: TestAccAwsCloudControlApiResource_DesiredState_InvalidPropertyValue (7.61s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 10.813s --- aws/resource_aws_cloudcontrolapi_resource_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/resource_aws_cloudcontrolapi_resource_test.go b/aws/resource_aws_cloudcontrolapi_resource_test.go index 86c3d23372a..9865968c17f 100644 --- a/aws/resource_aws_cloudcontrolapi_resource_test.go +++ b/aws/resource_aws_cloudcontrolapi_resource_test.go @@ -268,7 +268,7 @@ func TestAccAwsCloudControlApiResource_DesiredState_InvalidPropertyValue(t *test Steps: []resource.TestStep{ { Config: testAccAwsCloudControlApiResourceConfigDesiredStateInvalidPropertyValue(rName), - ExpectError: regexp.MustCompile(`LogGroupName: Does not match pattern`), + ExpectError: regexp.MustCompile(`Model validation failed`), }, }, }) From 2f8e351594fa37b5d5e51dccdba190124cc2beb5 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 22 Sep 2021 15:06:20 -0400 Subject: [PATCH 30/33] Rename 'aws/internal/service/cloudcontrolapi' to 'aws/internal/service/cloudcontrol'. --- aws/data_source_aws_cloudcontrolapi_resource.go | 2 +- .../{cloudcontrolapi => cloudcontrol}/finder/finder.go | 0 .../{cloudcontrolapi => cloudcontrol}/waiter/status.go | 2 +- .../{cloudcontrolapi => cloudcontrol}/waiter/waiter.go | 0 aws/resource_aws_cloudcontrolapi_resource.go | 4 ++-- aws/resource_aws_cloudcontrolapi_resource_test.go | 2 +- 6 files changed, 5 insertions(+), 5 deletions(-) rename aws/internal/service/{cloudcontrolapi => cloudcontrol}/finder/finder.go (100%) rename aws/internal/service/{cloudcontrolapi => cloudcontrol}/waiter/status.go (95%) rename aws/internal/service/{cloudcontrolapi => cloudcontrol}/waiter/waiter.go (100%) diff --git a/aws/data_source_aws_cloudcontrolapi_resource.go b/aws/data_source_aws_cloudcontrolapi_resource.go index ea9307205dd..54d6bf3ce6f 100644 --- a/aws/data_source_aws_cloudcontrolapi_resource.go +++ b/aws/data_source_aws_cloudcontrolapi_resource.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/cloudcontrolapi/finder" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/cloudcontrol/finder" ) func dataSourceAwsCloudControlApiResource() *schema.Resource { diff --git a/aws/internal/service/cloudcontrolapi/finder/finder.go b/aws/internal/service/cloudcontrol/finder/finder.go similarity index 100% rename from aws/internal/service/cloudcontrolapi/finder/finder.go rename to aws/internal/service/cloudcontrol/finder/finder.go diff --git a/aws/internal/service/cloudcontrolapi/waiter/status.go b/aws/internal/service/cloudcontrol/waiter/status.go similarity index 95% rename from aws/internal/service/cloudcontrolapi/waiter/status.go rename to aws/internal/service/cloudcontrol/waiter/status.go index f4169f6ddb5..cf622cad850 100644 --- a/aws/internal/service/cloudcontrolapi/waiter/status.go +++ b/aws/internal/service/cloudcontrol/waiter/status.go @@ -6,7 +6,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudcontrolapi" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/cloudcontrolapi/finder" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/cloudcontrol/finder" "github.com/terraform-providers/terraform-provider-aws/aws/internal/tfresource" ) diff --git a/aws/internal/service/cloudcontrolapi/waiter/waiter.go b/aws/internal/service/cloudcontrol/waiter/waiter.go similarity index 100% rename from aws/internal/service/cloudcontrolapi/waiter/waiter.go rename to aws/internal/service/cloudcontrol/waiter/waiter.go diff --git a/aws/resource_aws_cloudcontrolapi_resource.go b/aws/resource_aws_cloudcontrolapi_resource.go index 9508b5ab450..c337532af55 100644 --- a/aws/resource_aws_cloudcontrolapi_resource.go +++ b/aws/resource_aws_cloudcontrolapi_resource.go @@ -17,8 +17,8 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/mattbaird/jsonpatch" - "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/cloudcontrolapi/finder" - "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/cloudcontrolapi/waiter" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/cloudcontrol/finder" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/cloudcontrol/waiter" cffinder "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/cloudformation/finder" "github.com/terraform-providers/terraform-provider-aws/aws/internal/tfresource" ) diff --git a/aws/resource_aws_cloudcontrolapi_resource_test.go b/aws/resource_aws_cloudcontrolapi_resource_test.go index 9865968c17f..4f8451ebc5f 100644 --- a/aws/resource_aws_cloudcontrolapi_resource_test.go +++ b/aws/resource_aws_cloudcontrolapi_resource_test.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/cloudcontrolapi/finder" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/cloudcontrol/finder" "github.com/terraform-providers/terraform-provider-aws/aws/internal/tfresource" ) From e9f6d51826fda46c30921f2bd726aad3589769cc Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 30 Sep 2021 14:54:46 -0400 Subject: [PATCH 31/33] Remove use of private AWS SDK. --- go.mod | 2 -- go.sum | 18 ++++++++++++------ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index 4fb4b41d1fa..30785e2ba14 100644 --- a/go.mod +++ b/go.mod @@ -28,6 +28,4 @@ require ( gopkg.in/yaml.v2 v2.4.0 ) -replace github.com/aws/aws-sdk-go => github.com/hashicorp/aws-sdk-go-private v1.40.42-0.20210915192203-499245543dfd - replace github.com/hashicorp/terraform-plugin-sdk/v2 => github.com/gdavison/terraform-plugin-sdk/v2 v2.7.1-0.20210913224932-c7c2dbd9e010 diff --git a/go.sum b/go.sum index 3c60cc96fa2..10228b23ba2 100644 --- a/go.sum +++ b/go.sum @@ -63,6 +63,11 @@ github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6 github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= +github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM= +github.com/aws/aws-sdk-go v1.25.3/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/aws/aws-sdk-go v1.31.9/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= +github.com/aws/aws-sdk-go v1.40.53 h1:wi4UAslOQ1HfF2NjnIwI6st8n7sQg7shUUNLkaCgIpc= +github.com/aws/aws-sdk-go v1.40.53/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= github.com/beevik/etree v1.1.0 h1:T0xke/WvNtMoCqgzPhkX2r4rjY3GDZFi+FjpRZY2Jbs= github.com/beevik/etree v1.1.0/go.mod h1:r8Aw8JqVegEf0w2fDnATrX9VpkMcyFeM0FhwO62wh+A= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= @@ -107,6 +112,7 @@ github.com/go-git/go-git/v5 v5.4.2/go.mod h1:gQ1kArt6d+n+BGd+/B/I74HwRTLhth2+zti github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -162,14 +168,10 @@ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.9.0 h1:tmfUGbj6/nQxYZJWmUoY0NoGMLZBgDcyl+OlH9+vbcE= -github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.9.0/go.mod h1:C6GVuO9RWOrt6QCGTmLCOYuSHpkfQSBDuRqTteOlo0g= github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.10.0 h1:cClHI47voDkTrM7TpbXL0cTZBAseI0/1+j8pZ1sEzjA= github.com/hashicorp/aws-cloudformation-resource-schema-sdk-go v0.10.0/go.mod h1:C6GVuO9RWOrt6QCGTmLCOYuSHpkfQSBDuRqTteOlo0g= -github.com/hashicorp/aws-sdk-go-base v0.7.1 h1:7s/aR3hFn74tYPVihzDyZe7y/+BorN70rr9ZvpV3j3o= -github.com/hashicorp/aws-sdk-go-base v0.7.1/go.mod h1:2fRjWDv3jJBeN6mVWFHV6hFTNeFBx2gpDLQaZNxUVAY= -github.com/hashicorp/aws-sdk-go-private v1.40.42-0.20210915192203-499245543dfd h1:F8kyugZaV1xu7PWOqezDdeVNZxL2pG9KhGTOxnXyjzE= -github.com/hashicorp/aws-sdk-go-private v1.40.42-0.20210915192203-499245543dfd/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= +github.com/hashicorp/aws-sdk-go-base v1.0.0 h1:J7MMLOfSoDWkusy+cSzKYG1/aFyCzYJmdE0mod3/WLw= +github.com/hashicorp/aws-sdk-go-base v1.0.0/go.mod h1:2fRjWDv3jJBeN6mVWFHV6hFTNeFBx2gpDLQaZNxUVAY= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-checkpoint v0.5.0 h1:MFYpPZCnQqQTE18jFwSII6eUQrD/oxMFp3mlgcqk5mU= @@ -227,6 +229,9 @@ github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJS github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE= github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74= +github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= @@ -317,6 +322,7 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= From 571867db47b11a793bd8c38b0f5a7a3271f12c20 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 30 Sep 2021 15:17:09 -0400 Subject: [PATCH 32/33] Add CHANGELOG entry. --- .changelog/21110.txt | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .changelog/21110.txt diff --git a/.changelog/21110.txt b/.changelog/21110.txt new file mode 100644 index 00000000000..02eb859d5bc --- /dev/null +++ b/.changelog/21110.txt @@ -0,0 +1,7 @@ +```release-note:resource +aws_cloudcontrolapi_resource +``` + +```release-note:new-data-source +aws_cloudcontrolapi_resource +``` \ No newline at end of file From 48dc210943a7bdae891dc923b00d7031a4d4afd7 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 30 Sep 2021 15:46:46 -0400 Subject: [PATCH 33/33] Skip any Cloud Control API acceptance tests that return 'UnsupportedActionException'. --- aws/resource_aws_cloudcontrolapi_resource_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/aws/resource_aws_cloudcontrolapi_resource_test.go b/aws/resource_aws_cloudcontrolapi_resource_test.go index 4f8451ebc5f..ed181294d67 100644 --- a/aws/resource_aws_cloudcontrolapi_resource_test.go +++ b/aws/resource_aws_cloudcontrolapi_resource_test.go @@ -15,6 +15,16 @@ import ( "github.com/terraform-providers/terraform-provider-aws/aws/internal/tfresource" ) +func init() { + RegisterServiceErrorCheckFunc(cloudcontrolapi.EndpointsID, testAccErrorCheckSkipCloudControlAPI) +} + +func testAccErrorCheckSkipCloudControlAPI(t *testing.T) resource.ErrorCheckFunc { + return testAccErrorCheckSkipMessagesContaining(t, + "UnsupportedActionException", + ) +} + func TestAccAwsCloudControlApiResource_basic(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_cloudcontrolapi_resource.test"