From 5edaece497ef3f93ff6f1aedf39e29b2e95f4126 Mon Sep 17 00:00:00 2001 From: Louis-Philippe Bedard Date: Mon, 25 Sep 2017 11:30:41 -0400 Subject: [PATCH 01/36] Force interpretation of the resource to be of a different content type (useful to get the body of non-binary resource that are not considered as text even if they are, i.e. certificates) --- aws/data_source_aws_s3_bucket_object.go | 12 +++- aws/data_source_aws_s3_bucket_object_test.go | 57 +++++++++++++++++++ website/docs/d/s3_bucket_object.html.markdown | 1 + 3 files changed, 69 insertions(+), 1 deletion(-) diff --git a/aws/data_source_aws_s3_bucket_object.go b/aws/data_source_aws_s3_bucket_object.go index 2eff5e6dab27..48296914c827 100644 --- a/aws/data_source_aws_s3_bucket_object.go +++ b/aws/data_source_aws_s3_bucket_object.go @@ -62,6 +62,10 @@ func dataSourceAwsS3BucketObject() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "forced_content_type": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + }, "key": &schema.Schema{ Type: schema.TypeString, Required: true, @@ -110,6 +114,7 @@ func dataSourceAwsS3BucketObjectRead(d *schema.ResourceData, meta interface{}) e bucket := d.Get("bucket").(string) key := d.Get("key").(string) + forcedContentType := d.Get("forced_content_type").(string) input := s3.HeadObjectInput{ Bucket: aws.String(bucket), @@ -139,6 +144,11 @@ func dataSourceAwsS3BucketObjectRead(d *schema.ResourceData, meta interface{}) e bucket+key, versionText) } + contentType := *out.ContentType + if forcedContentType == "" { + forcedContentType = contentType + } + log.Printf("[DEBUG] Received S3 object: %s", out) d.SetId(uniqueId) @@ -167,7 +177,7 @@ func dataSourceAwsS3BucketObjectRead(d *schema.ResourceData, meta interface{}) e d.Set("storage_class", out.StorageClass) } - if isContentTypeAllowed(out.ContentType) { + if isContentTypeAllowed(&forcedContentType) { input := s3.GetObjectInput{ Bucket: aws.String(bucket), Key: aws.String(key), diff --git a/aws/data_source_aws_s3_bucket_object_test.go b/aws/data_source_aws_s3_bucket_object_test.go index 8bfe6c73f2dd..24466ae67df4 100644 --- a/aws/data_source_aws_s3_bucket_object_test.go +++ b/aws/data_source_aws_s3_bucket_object_test.go @@ -80,6 +80,40 @@ func TestAccDataSourceAWSS3BucketObject_readableBody(t *testing.T) { }) } +func TestAccDataSourceAWSS3BucketObject_forcedContentType_readableBody(t *testing.T) { + rInt := acctest.RandInt() + resourceOnlyConf, conf := testAccAWSDataSourceS3ObjectConfig_forcedContentType_readableBody(rInt) + + var rObj s3.GetObjectOutput + var dsObj s3.GetObjectOutput + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + PreventPostDestroyRefresh: true, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: resourceOnlyConf, + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSS3BucketObjectExists("aws_s3_bucket_object.object", &rObj), + ), + }, + resource.TestStep{ + Config: conf, + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsS3ObjectDataSourceExists("data.aws_s3_bucket_object.obj", &dsObj), + resource.TestCheckResourceAttr("data.aws_s3_bucket_object.obj", "content_length", "120"), + resource.TestCheckResourceAttr("data.aws_s3_bucket_object.obj", "content_type", "application/x-x509-ca-cert"), + resource.TestCheckResourceAttr("data.aws_s3_bucket_object.obj", "etag", "877716107971cdd406981bbbe85c97f4"), + resource.TestMatchResourceAttr("data.aws_s3_bucket_object.obj", "last_modified", + regexp.MustCompile("^[a-zA-Z]{3}, [0-9]+ [a-zA-Z]+ [0-9]{4} [0-9:]+ [A-Z]+$")), + resource.TestCheckResourceAttr("data.aws_s3_bucket_object.obj", "body", "-----BEGIN CERTIFICATE-----\nbWFpbiBDb250cm9sIFZhbGlkYXRXDDEdMBsGA1UECxMUUG9zaXRpdmVTU0wgV2ls==\n-----END CERTIFICATE-----"), + ), + }, + }, + }) +} + func TestAccDataSourceAWSS3BucketObject_kmsEncrypted(t *testing.T) { rInt := acctest.RandInt() resourceOnlyConf, conf := testAccAWSDataSourceS3ObjectConfig_kmsEncrypted(rInt) @@ -238,6 +272,29 @@ data "aws_s3_bucket_object" "obj" { return resources, both } +func testAccAWSDataSourceS3ObjectConfig_forcedContentType_readableBody(randInt int) (string, string) { + resources := fmt.Sprintf(` +resource "aws_s3_bucket" "object_bucket" { + bucket = "tf-object-test-bucket-%d" +} +resource "aws_s3_bucket_object" "object" { + bucket = "${aws_s3_bucket.object_bucket.bucket}" + key = "tf-testing-obj-%d-forced-readable" + content = "-----BEGIN CERTIFICATE-----\nbWFpbiBDb250cm9sIFZhbGlkYXRXDDEdMBsGA1UECxMUUG9zaXRpdmVTU0wgV2ls==\n-----END CERTIFICATE-----" + content_type = "application/x-x509-ca-cert" +} +`, randInt, randInt) + + both := fmt.Sprintf(`%s +data "aws_s3_bucket_object" "obj" { + bucket = "tf-object-test-bucket-%d" + key = "tf-testing-obj-%d-forced-readable" + forced_content_type = "text/text" +}`, resources, randInt, randInt) + + return resources, both +} + func testAccAWSDataSourceS3ObjectConfig_kmsEncrypted(randInt int) (string, string) { resources := fmt.Sprintf(` resource "aws_s3_bucket" "object_bucket" { diff --git a/website/docs/d/s3_bucket_object.html.markdown b/website/docs/d/s3_bucket_object.html.markdown index 0a7217b27b22..d29b53937143 100644 --- a/website/docs/d/s3_bucket_object.html.markdown +++ b/website/docs/d/s3_bucket_object.html.markdown @@ -58,6 +58,7 @@ The following arguments are supported: * `bucket` - (Required) The name of the bucket to read the object from * `key` - (Required) The full path to the object inside the bucket * `version_id` - (Optional) Specific version ID of the object returned (defaults to latest version) +* `forced_content_type` - (Optional) Force interpretation of the resource to be of a different content type (useful to get the body of non-binary resource that are not considered as text even if they are, i.e. certificates) ## Attributes Reference From dfce30e3939563a5d5aa418224c72c8e33a6c751 Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 20 Aug 2018 14:05:02 -0400 Subject: [PATCH 02/36] Update S3 object on mismatched etag If the saved etag from state file does not match the actual etag on the S3 object, that means that the resource has been modified outside of terraform, so we force the update of the resource. --- aws/resource_aws_s3_bucket_object.go | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/aws/resource_aws_s3_bucket_object.go b/aws/resource_aws_s3_bucket_object.go index 63a3e7d83226..8edfbebd65c7 100644 --- a/aws/resource_aws_s3_bucket_object.go +++ b/aws/resource_aws_s3_bucket_object.go @@ -26,6 +26,12 @@ func resourceAwsS3BucketObject() *schema.Resource { Read: resourceAwsS3BucketObjectRead, Update: resourceAwsS3BucketObjectPut, Delete: resourceAwsS3BucketObjectDelete, + CustomizeDiff: func(diff *schema.ResourceDiff, v interface{}) error { + if diff.Get("etag_changed").(bool) { + diff.SetNewComputed("etag") + } + return nil + }, Schema: map[string]*schema.Schema{ "bucket": { @@ -137,6 +143,11 @@ func resourceAwsS3BucketObject() *schema.Resource { ConflictsWith: []string{"kms_key_id", "server_side_encryption"}, }, + "etag_changed": { + Type: schema.TypeBool, + Computed: true, + }, + "version_id": { Type: schema.TypeString, Computed: true, @@ -310,7 +321,12 @@ func resourceAwsS3BucketObjectRead(d *schema.ResourceData, meta interface{}) err d.Set("kms_key_id", resp.SSEKMSKeyId) } } - d.Set("etag", strings.Trim(*resp.ETag, `"`)) + + // We detect if the last saved etag does not match the actual etag, if so, that mean that the s3 object has been + // modified outside of terraform and then, we will force the update of the resource. + actualEtag := strings.Trim(*resp.ETag, `"`) + d.Set("etag_changed", d.Get("etag") != actualEtag) + d.Set("etag", actualEtag) // The "STANDARD" (which is also the default) storage // class when set would not be included in the results. From 6dc48ee49e1b7213568d668805aa9a64e14ebbf4 Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 20 Aug 2018 14:11:51 -0400 Subject: [PATCH 03/36] Do not delete version history on s3 object delete On versioned bucket, we should not delete the whole history of a file if the file is renamed/deleted. We added an optional parameter to enforce bucket full object deletion if desired, but that should not be the default behavior. --- aws/data_source_aws_s3_bucket_object_test.go | 1 + aws/resource_aws_s3_bucket_object.go | 8 +++++++- website/docs/r/s3_bucket_object.html.markdown | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/aws/data_source_aws_s3_bucket_object_test.go b/aws/data_source_aws_s3_bucket_object_test.go index 8bfe6c73f2dd..ef4a8bd4f4f9 100644 --- a/aws/data_source_aws_s3_bucket_object_test.go +++ b/aws/data_source_aws_s3_bucket_object_test.go @@ -285,6 +285,7 @@ CONTENT content_disposition = "attachment" content_encoding = "identity" content_language = "en-GB" + remove_all_on_delete = true tags { Key1 = "Value 1" } diff --git a/aws/resource_aws_s3_bucket_object.go b/aws/resource_aws_s3_bucket_object.go index 63a3e7d83226..197c3f78d9b5 100644 --- a/aws/resource_aws_s3_bucket_object.go +++ b/aws/resource_aws_s3_bucket_object.go @@ -148,6 +148,11 @@ func resourceAwsS3BucketObject() *schema.Resource { Type: schema.TypeString, Optional: true, }, + + "remove_all_on_delete": { + Type: schema.TypeBool, + Optional: true, + }, }, } } @@ -339,8 +344,9 @@ func resourceAwsS3BucketObjectDelete(d *schema.ResourceData, meta interface{}) e bucket := d.Get("bucket").(string) key := d.Get("key").(string) + delete_versions := d.Get("remove_all_on_delete").(bool) - if _, ok := d.GetOk("version_id"); ok { + if _, ok := d.GetOk("version_id"); ok && delete_versions { // Bucket is versioned, we need to delete all versions vInput := s3.ListObjectVersionsInput{ Bucket: aws.String(bucket), diff --git a/website/docs/r/s3_bucket_object.html.markdown b/website/docs/r/s3_bucket_object.html.markdown index 4e9d05f397c3..6d0506b15098 100644 --- a/website/docs/r/s3_bucket_object.html.markdown +++ b/website/docs/r/s3_bucket_object.html.markdown @@ -103,6 +103,7 @@ This attribute is not compatible with KMS encryption, `kms_key_id` or `server_si This value is a fully qualified **ARN** of the KMS Key. If using `aws_kms_key`, use the exported `arn` attribute: `kms_key_id = "${aws_kms_key.foo.arn}"` +* `remove_all_on_delete` - (Optional) Indicates that all previous version of the object must be deleted (applies only if versioning is enabled on the bucket). * `tags` - (Optional) A mapping of tags to assign to the object. Either `source` or `content` must be provided to specify the bucket content. From b7ee3d9d71edbdf31c64c82cd3496c3f265eebe7 Mon Sep 17 00:00:00 2001 From: Julien Duchesne Date: Tue, 18 Sep 2018 21:42:21 -0400 Subject: [PATCH 04/36] Ignore SSM parameter overwrite change Allows to go from overwrite "true" to overwrite "false" --- aws/resource_aws_ssm_parameter.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/aws/resource_aws_ssm_parameter.go b/aws/resource_aws_ssm_parameter.go index f4849ce3da1e..4621ffcd8c97 100644 --- a/aws/resource_aws_ssm_parameter.go +++ b/aws/resource_aws_ssm_parameter.go @@ -58,8 +58,9 @@ func resourceAwsSsmParameter() *schema.Resource { Computed: true, }, "overwrite": { - Type: schema.TypeBool, - Optional: true, + Type: schema.TypeBool, + Optional: true, + DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool { return true }, }, "allowed_pattern": { Type: schema.TypeString, From dbbe46af52707d6ee965c66161637c11e7779082 Mon Sep 17 00:00:00 2001 From: Julien Duchesne Date: Wed, 19 Sep 2018 06:58:04 -0400 Subject: [PATCH 05/36] Completely remove complicated overwrite logic --- aws/resource_aws_ssm_parameter.go | 17 ++++---------- aws/resource_aws_ssm_parameter_test.go | 32 -------------------------- 2 files changed, 5 insertions(+), 44 deletions(-) diff --git a/aws/resource_aws_ssm_parameter.go b/aws/resource_aws_ssm_parameter.go index 4621ffcd8c97..941915a0d3aa 100644 --- a/aws/resource_aws_ssm_parameter.go +++ b/aws/resource_aws_ssm_parameter.go @@ -61,6 +61,7 @@ func resourceAwsSsmParameter() *schema.Resource { Type: schema.TypeBool, Optional: true, DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool { return true }, + Deprecated: "The `overwrite` attribute is no longer used", }, "allowed_pattern": { Type: schema.TypeString, @@ -175,7 +176,7 @@ func resourceAwsSsmParameterPut(d *schema.ResourceData, meta interface{}) error Name: aws.String(d.Get("name").(string)), Type: aws.String(d.Get("type").(string)), Value: aws.String(d.Get("value").(string)), - Overwrite: aws.Bool(shouldUpdateSsmParameter(d)), + Overwrite: aws.Bool(!d.IsNewResource()), AllowedPattern: aws.String(d.Get("allowed_pattern").(string)), } @@ -191,6 +192,9 @@ func resourceAwsSsmParameterPut(d *schema.ResourceData, meta interface{}) error log.Printf("[DEBUG] Waiting for SSM Parameter %v to be updated", d.Get("name")) if _, err := ssmconn.PutParameter(paramInput); err != nil { + if isAWSErr(err, ssm.ErrCodeParameterAlreadyExists, "") { + return fmt.Errorf("The parameter already exists") + } return fmt.Errorf("error creating SSM parameter: %s", err) } @@ -202,14 +206,3 @@ func resourceAwsSsmParameterPut(d *schema.ResourceData, meta interface{}) error return resourceAwsSsmParameterRead(d, meta) } - -func shouldUpdateSsmParameter(d *schema.ResourceData) bool { - // If the user has specified a preference, return their preference - if value, ok := d.GetOkExists("overwrite"); ok { - return value.(bool) - } - - // Since the user has not specified a preference, obey lifecycle rules - // if it is not a new resource, otherwise overwrite should be set to false. - return !d.IsNewResource() -} diff --git a/aws/resource_aws_ssm_parameter_test.go b/aws/resource_aws_ssm_parameter_test.go index 221ab6faa000..f41d589c7a55 100644 --- a/aws/resource_aws_ssm_parameter_test.go +++ b/aws/resource_aws_ssm_parameter_test.go @@ -408,35 +408,3 @@ resource "aws_kms_alias" "test_alias" { } `, rName, value, keyAlias) } - -func TestAWSSSMParameterShouldUpdate(t *testing.T) { - data := resourceAwsSsmParameter().TestResourceData() - failure := false - - if !shouldUpdateSsmParameter(data) { - t.Logf("Existing resources should be overwritten if the values don't match!") - failure = true - } - - data.MarkNewResource() - if shouldUpdateSsmParameter(data) { - t.Logf("New resources must never be overwritten, this will overwrite parameters created outside of the system") - failure = true - } - - data = resourceAwsSsmParameter().TestResourceData() - data.Set("overwrite", true) - if !shouldUpdateSsmParameter(data) { - t.Logf("Resources should always be overwritten if the user requests it") - failure = true - } - - data.Set("overwrite", false) - if shouldUpdateSsmParameter(data) { - t.Logf("Resources should never be overwritten if the user requests it") - failure = true - } - if failure { - t.Fail() - } -} From d3e88d51b17fdc04b32cb32163e9cf7ef3444d5c Mon Sep 17 00:00:00 2001 From: Julien Duchesne Date: Wed, 19 Sep 2018 07:05:44 -0400 Subject: [PATCH 06/36] Remove overwrite from doc --- aws/resource_aws_ssm_parameter.go | 2 +- website/docs/r/ssm_parameter.html.markdown | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/aws/resource_aws_ssm_parameter.go b/aws/resource_aws_ssm_parameter.go index 941915a0d3aa..997db0f8df1f 100644 --- a/aws/resource_aws_ssm_parameter.go +++ b/aws/resource_aws_ssm_parameter.go @@ -61,7 +61,7 @@ func resourceAwsSsmParameter() *schema.Resource { Type: schema.TypeBool, Optional: true, DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool { return true }, - Deprecated: "The `overwrite` attribute is no longer used", + Deprecated: "The `overwrite` attribute is no longer used. Existing resources are now always overwritten.", }, "allowed_pattern": { Type: schema.TypeString, diff --git a/website/docs/r/ssm_parameter.html.markdown b/website/docs/r/ssm_parameter.html.markdown index 7426e492c712..60cdbb01b4a8 100644 --- a/website/docs/r/ssm_parameter.html.markdown +++ b/website/docs/r/ssm_parameter.html.markdown @@ -62,7 +62,6 @@ The following arguments are supported: * `value` - (Required) The value of the parameter. * `description` - (Optional) The description of the parameter. * `key_id` - (Optional) The KMS key id or arn for encrypting a SecureString. -* `overwrite` - (Optional) Overwrite an existing parameter. If not specified, will default to `false` if the resource has not been created by terraform to avoid overwrite of existing resource and will default to `true` otherwise (terraform lifecycle rules should then be used to manage the update behavior). * `allowed_pattern` - (Optional) A regular expression used to validate the parameter value. * `tags` - (Optional) A mapping of tags to assign to the object. From bd620dc7845d09a3a8dcc2c2891b74142269ac8f Mon Sep 17 00:00:00 2001 From: Julien Duchesne Date: Thu, 27 Sep 2018 10:42:00 -0400 Subject: [PATCH 07/36] Add resource for a single dynamodb attribute --- aws/provider.go | 1 + ...ource_aws_dynamodb_table_item_attribute.go | 182 ++++++++++++++++++ 2 files changed, 183 insertions(+) create mode 100644 aws/resource_aws_dynamodb_table_item_attribute.go diff --git a/aws/provider.go b/aws/provider.go index 5e31714c7fc1..4d369f8de283 100644 --- a/aws/provider.go +++ b/aws/provider.go @@ -396,6 +396,7 @@ func Provider() terraform.ResourceProvider { "aws_dx_public_virtual_interface": resourceAwsDxPublicVirtualInterface(), "aws_dynamodb_table": resourceAwsDynamoDbTable(), "aws_dynamodb_table_item": resourceAwsDynamoDbTableItem(), + "aws_dynamodb_table_item_attribute": resourceAwsDynamoDbTableItemAttribute(), "aws_dynamodb_global_table": resourceAwsDynamoDbGlobalTable(), "aws_ebs_snapshot": resourceAwsEbsSnapshot(), "aws_ebs_volume": resourceAwsEbsVolume(), diff --git a/aws/resource_aws_dynamodb_table_item_attribute.go b/aws/resource_aws_dynamodb_table_item_attribute.go new file mode 100644 index 000000000000..9856e22fc222 --- /dev/null +++ b/aws/resource_aws_dynamodb_table_item_attribute.go @@ -0,0 +1,182 @@ +package aws + +import ( + "fmt" + "log" + "strings" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/dynamodb" + "github.com/hashicorp/terraform/helper/schema" +) + +const ( + updateExpressionSet = "SET" + updateExpressionRemove = "REMOVE" +) + +func resourceAwsDynamoDbTableItemAttribute() *schema.Resource { + return &schema.Resource{ + Create: resourceAwsDynamoDbTableItemAttributeUpdate, + Read: resourceAwsDynamoDbTableItemAttributeRead, + Update: resourceAwsDynamoDbTableItemAttributeUpdate, + Delete: resourceAwsDynamoDbTableItemAttributeDelete, + + Schema: map[string]*schema.Schema{ + "table_name": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "hash_key": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "range_key": { + Type: schema.TypeString, + ForceNew: true, + Optional: true, + }, + "attribute_key": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "attribute_value": { + Type: schema.TypeString, + Required: true, + }, + }, + } +} + +func resourceAwsDynamoDbTableItemAttributeDelete(d *schema.ResourceData, meta interface{}) error { + return resourceAwsDynamoDbTableItemAttributeModify(updateExpressionRemove, d, meta) +} + +func resourceAwsDynamoDbTableItemAttributeUpdate(d *schema.ResourceData, meta interface{}) error { + if err := resourceAwsDynamoDbTableItemAttributeModify(updateExpressionSet, d, meta); err == nil { + return resourceAwsDynamoDbTableItemAttributeRead(d, meta) + } else { + return err + } +} + +func resourceAwsDynamoDbTableItemAttributeModify(action string, d *schema.ResourceData, meta interface{}) error { + log.Printf("[DEBUG] %s DynamoDB table %s", action, d.Id()) + conn := meta.(*AWSClient).dynamodbconn + + tableName := d.Get("table_name").(string) + + hashKey := d.Get("hash_key").(string) + rangeKey := d.Get("range_key").(string) + attributeKey := d.Get("attribute_key").(string) + attributeValue := d.Get("attribute_value").(string) + + hashKeyName, rangeKeyName, err := resourceAwsDynamoDbTableItemAttributeGetKeysInfo(conn, tableName) + if err != nil { + return err + } + + updateItemInput := &dynamodb.UpdateItemInput{ + Key: resourceAwsDynamoDbTableItemAttributeGetQueryKey(hashKeyName, hashKey, rangeKeyName, rangeKey), + TableName: aws.String(tableName), + } + + if d.IsNewResource() { + updateItemInput.ConditionExpression = aws.String(fmt.Sprintf("attribute_not_exists(%s)", attributeKey)) + } + + if action == updateExpressionSet { + updateItemInput.UpdateExpression = aws.String(fmt.Sprintf("%s %s = :v", updateExpressionSet, attributeKey)) + updateItemInput.ExpressionAttributeValues = map[string]*dynamodb.AttributeValue{ + ":v": { + S: aws.String(attributeValue), + }, + } + } else if action == updateExpressionRemove { + updateItemInput.UpdateExpression = aws.String(fmt.Sprintf("%s %s", updateExpressionRemove, attributeKey)) + } + + if _, err := conn.UpdateItem(updateItemInput); err != nil { + return err + } + + id := fmt.Sprintf("%s:%s:%s:%s", tableName, hashKey, rangeKey, attributeKey) + d.SetId(id) + + return nil +} + +func resourceAwsDynamoDbTableItemAttributeRead(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).dynamodbconn + + log.Printf("[DEBUG] Loading data for DynamoDB table item attribute '%s'", d.Id()) + + idParts := strings.Split(d.Id(), ":") + tableName, hashKey, rangeKey, attributeKey := idParts[0], idParts[1], idParts[2], idParts[3] + + hashKeyName, rangeKeyName, err := resourceAwsDynamoDbTableItemAttributeGetKeysInfo(conn, tableName) + if err != nil { + return err + } + + result, err := conn.GetItem(&dynamodb.GetItemInput{ + ConsistentRead: aws.Bool(true), + Key: resourceAwsDynamoDbTableItemAttributeGetQueryKey(hashKeyName, hashKey, rangeKeyName, rangeKey), + TableName: aws.String(tableName), + ProjectionExpression: aws.String(attributeKey), + }) + if err != nil { + if isAWSErr(err, dynamodb.ErrCodeResourceNotFoundException, "") { + log.Printf("[WARN] Dynamodb Table Item (%s) not found, error code (404)", d.Id()) + d.SetId("") + return nil + } + + return fmt.Errorf("Error retrieving DynamoDB table item: %s", err) + } + + if result.Item == nil { + log.Printf("[WARN] Dynamodb Table Item (%s) not found", d.Id()) + d.SetId("") + return nil + } + d.Set("table_name", tableName) + d.Set("hash_key", hashKey) + d.Set("range_key", rangeKey) + d.Set("attribute_key", attributeKey) + d.Set("attribute_value", result.Item[attributeKey].S) + + return nil +} + +func resourceAwsDynamoDbTableItemAttributeGetKeysInfo(conn *dynamodb.DynamoDB, tableName string) (string, string, error) { + var hashKeyName, rangeKeyName string + if out, err := conn.DescribeTable(&dynamodb.DescribeTableInput{ + TableName: aws.String(tableName), + }); err == nil { + for _, key := range out.Table.KeySchema { + if *key.KeyType == dynamodb.KeyTypeHash { + hashKeyName = *key.AttributeName + } else if *key.KeyType == dynamodb.KeyTypeRange { + rangeKeyName = *key.AttributeName + } + } + } else { + return "", "", fmt.Errorf("Error descring table %s: %v", tableName, err) + } + + return hashKeyName, rangeKeyName, nil +} + +func resourceAwsDynamoDbTableItemAttributeGetQueryKey(hashKeyName string, hashKeyValue string, rangeKeyName string, rangeKeyValue string) map[string]*dynamodb.AttributeValue { + queryKey := map[string]*dynamodb.AttributeValue{ + hashKeyName: &dynamodb.AttributeValue{S: aws.String(hashKeyValue)}, + } + if rangeKeyValue != "" { + queryKey[rangeKeyName] = &dynamodb.AttributeValue{S: aws.String(rangeKeyValue)} + } + return queryKey +} From 11c98145d19489d90a9461aad5394820280fe63f Mon Sep 17 00:00:00 2001 From: Julien Duchesne Date: Fri, 28 Sep 2018 23:01:07 -0400 Subject: [PATCH 08/36] Add tests for dynamodb_table_item_attribute --- ...ource_aws_dynamodb_table_item_attribute.go | 45 +-- ..._aws_dynamodb_table_item_attribute_test.go | 299 ++++++++++++++++++ 2 files changed, 324 insertions(+), 20 deletions(-) create mode 100644 aws/resource_aws_dynamodb_table_item_attribute_test.go diff --git a/aws/resource_aws_dynamodb_table_item_attribute.go b/aws/resource_aws_dynamodb_table_item_attribute.go index 9856e22fc222..add08ecf6600 100644 --- a/aws/resource_aws_dynamodb_table_item_attribute.go +++ b/aws/resource_aws_dynamodb_table_item_attribute.go @@ -28,12 +28,12 @@ func resourceAwsDynamoDbTableItemAttribute() *schema.Resource { Required: true, ForceNew: true, }, - "hash_key": { + "hash_key_value": { Type: schema.TypeString, Required: true, ForceNew: true, }, - "range_key": { + "range_key_value": { Type: schema.TypeString, ForceNew: true, Optional: true, @@ -56,11 +56,10 @@ func resourceAwsDynamoDbTableItemAttributeDelete(d *schema.ResourceData, meta in } func resourceAwsDynamoDbTableItemAttributeUpdate(d *schema.ResourceData, meta interface{}) error { - if err := resourceAwsDynamoDbTableItemAttributeModify(updateExpressionSet, d, meta); err == nil { - return resourceAwsDynamoDbTableItemAttributeRead(d, meta) - } else { + if err := resourceAwsDynamoDbTableItemAttributeModify(updateExpressionSet, d, meta); err != nil { return err } + return resourceAwsDynamoDbTableItemAttributeRead(d, meta) } func resourceAwsDynamoDbTableItemAttributeModify(action string, d *schema.ResourceData, meta interface{}) error { @@ -69,8 +68,8 @@ func resourceAwsDynamoDbTableItemAttributeModify(action string, d *schema.Resour tableName := d.Get("table_name").(string) - hashKey := d.Get("hash_key").(string) - rangeKey := d.Get("range_key").(string) + hashKeyValue := d.Get("hash_key_value").(string) + rangeKeyValue := d.Get("range_key_value").(string) attributeKey := d.Get("attribute_key").(string) attributeValue := d.Get("attribute_value").(string) @@ -80,30 +79,33 @@ func resourceAwsDynamoDbTableItemAttributeModify(action string, d *schema.Resour } updateItemInput := &dynamodb.UpdateItemInput{ - Key: resourceAwsDynamoDbTableItemAttributeGetQueryKey(hashKeyName, hashKey, rangeKeyName, rangeKey), + Key: resourceAwsDynamoDbTableItemAttributeGetQueryKey(hashKeyName, hashKeyValue, rangeKeyName, rangeKeyValue), TableName: aws.String(tableName), } if d.IsNewResource() { - updateItemInput.ConditionExpression = aws.String(fmt.Sprintf("attribute_not_exists(%s)", attributeKey)) + updateItemInput.ConditionExpression = aws.String("attribute_not_exists(#key)") } + updateItemInput.ExpressionAttributeNames = map[string]*string{ + "#key": aws.String(attributeKey), + } if action == updateExpressionSet { - updateItemInput.UpdateExpression = aws.String(fmt.Sprintf("%s %s = :v", updateExpressionSet, attributeKey)) + updateItemInput.UpdateExpression = aws.String(fmt.Sprintf("%s #key = :v", updateExpressionSet)) updateItemInput.ExpressionAttributeValues = map[string]*dynamodb.AttributeValue{ ":v": { S: aws.String(attributeValue), }, } } else if action == updateExpressionRemove { - updateItemInput.UpdateExpression = aws.String(fmt.Sprintf("%s %s", updateExpressionRemove, attributeKey)) + updateItemInput.UpdateExpression = aws.String(fmt.Sprintf("%s #key", updateExpressionRemove)) } if _, err := conn.UpdateItem(updateItemInput); err != nil { return err } - id := fmt.Sprintf("%s:%s:%s:%s", tableName, hashKey, rangeKey, attributeKey) + id := fmt.Sprintf("%s:%s:%s:%s", tableName, hashKeyValue, rangeKeyValue, attributeKey) d.SetId(id) return nil @@ -115,7 +117,7 @@ func resourceAwsDynamoDbTableItemAttributeRead(d *schema.ResourceData, meta inte log.Printf("[DEBUG] Loading data for DynamoDB table item attribute '%s'", d.Id()) idParts := strings.Split(d.Id(), ":") - tableName, hashKey, rangeKey, attributeKey := idParts[0], idParts[1], idParts[2], idParts[3] + tableName, hashKeyValue, rangeKeyValue, attributeKey := idParts[0], idParts[1], idParts[2], idParts[3] hashKeyName, rangeKeyName, err := resourceAwsDynamoDbTableItemAttributeGetKeysInfo(conn, tableName) if err != nil { @@ -123,10 +125,13 @@ func resourceAwsDynamoDbTableItemAttributeRead(d *schema.ResourceData, meta inte } result, err := conn.GetItem(&dynamodb.GetItemInput{ - ConsistentRead: aws.Bool(true), - Key: resourceAwsDynamoDbTableItemAttributeGetQueryKey(hashKeyName, hashKey, rangeKeyName, rangeKey), + ConsistentRead: aws.Bool(true), + ExpressionAttributeNames: map[string]*string{ + "#key": aws.String(attributeKey), + }, + Key: resourceAwsDynamoDbTableItemAttributeGetQueryKey(hashKeyName, hashKeyValue, rangeKeyName, rangeKeyValue), TableName: aws.String(tableName), - ProjectionExpression: aws.String(attributeKey), + ProjectionExpression: aws.String("#key"), }) if err != nil { if isAWSErr(err, dynamodb.ErrCodeResourceNotFoundException, "") { @@ -144,8 +149,8 @@ func resourceAwsDynamoDbTableItemAttributeRead(d *schema.ResourceData, meta inte return nil } d.Set("table_name", tableName) - d.Set("hash_key", hashKey) - d.Set("range_key", rangeKey) + d.Set("hash_key_value", hashKeyValue) + d.Set("range_key_value", rangeKeyValue) d.Set("attribute_key", attributeKey) d.Set("attribute_value", result.Item[attributeKey].S) @@ -165,7 +170,7 @@ func resourceAwsDynamoDbTableItemAttributeGetKeysInfo(conn *dynamodb.DynamoDB, t } } } else { - return "", "", fmt.Errorf("Error descring table %s: %v", tableName, err) + return "", "", fmt.Errorf("Error describing table %s: %v", tableName, err) } return hashKeyName, rangeKeyName, nil @@ -173,7 +178,7 @@ func resourceAwsDynamoDbTableItemAttributeGetKeysInfo(conn *dynamodb.DynamoDB, t func resourceAwsDynamoDbTableItemAttributeGetQueryKey(hashKeyName string, hashKeyValue string, rangeKeyName string, rangeKeyValue string) map[string]*dynamodb.AttributeValue { queryKey := map[string]*dynamodb.AttributeValue{ - hashKeyName: &dynamodb.AttributeValue{S: aws.String(hashKeyValue)}, + hashKeyName: {S: aws.String(hashKeyValue)}, } if rangeKeyValue != "" { queryKey[rangeKeyName] = &dynamodb.AttributeValue{S: aws.String(rangeKeyValue)} diff --git a/aws/resource_aws_dynamodb_table_item_attribute_test.go b/aws/resource_aws_dynamodb_table_item_attribute_test.go new file mode 100644 index 000000000000..1ebbd52c3bfd --- /dev/null +++ b/aws/resource_aws_dynamodb_table_item_attribute_test.go @@ -0,0 +1,299 @@ +package aws + +import ( + "fmt" + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/dynamodb" + "github.com/hashicorp/terraform/helper/acctest" + "github.com/hashicorp/terraform/helper/resource" + "github.com/hashicorp/terraform/terraform" + "testing" +) + +const resourceName = "aws_dynamodb_table_item_attribute.test" + +func TestAccAWSDynamoDbTableItemAttribute_basic(t *testing.T) { + tableName := fmt.Sprintf("tf-acc-test-%s", acctest.RandString(8)) + hashKey := fmt.Sprintf("%s", acctest.RandString(8)) + attributeKey := fmt.Sprintf("%s", acctest.RandString(8)) + attributeValue := fmt.Sprintf("%s", acctest.RandString(8)) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSDynamoDbItemAttributeDestroy(hashKey, ""), + Steps: []resource.TestStep{ + { + Config: testAccAWSDynamoDbItemAttributeConfigBasic(tableName, hashKey, attributeKey, attributeValue), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSDynamoDbTableItemAttributeExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "table_name", tableName), + resource.TestCheckResourceAttr(resourceName, "hash_key_value", "hashKeyValue"), + resource.TestCheckResourceAttr(resourceName, "range_key_value", ""), + resource.TestCheckResourceAttr(resourceName, "attribute_key", attributeKey), + resource.TestCheckResourceAttr(resourceName, "attribute_value", attributeValue), + ), + }, + }, + }) +} + +func TestAccAWSDynamoDbTableItemAttribute_update(t *testing.T) { + tableName := fmt.Sprintf("tf-acc-test-%s", acctest.RandString(8)) + hashKey := fmt.Sprintf("%s", acctest.RandString(8)) + attributeKey := fmt.Sprintf("%s", acctest.RandString(8)) + attributeValue := fmt.Sprintf("%s", acctest.RandString(8)) + attributeValue2 := fmt.Sprintf("%s", acctest.RandString(8)) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSDynamoDbItemAttributeDestroy(hashKey, ""), + Steps: []resource.TestStep{ + { + Config: testAccAWSDynamoDbItemAttributeConfigBasic(tableName, hashKey, attributeKey, attributeValue), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSDynamoDbTableItemAttributeExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "table_name", tableName), + resource.TestCheckResourceAttr(resourceName, "hash_key_value", "hashKeyValue"), + resource.TestCheckResourceAttr(resourceName, "range_key_value", ""), + resource.TestCheckResourceAttr(resourceName, "attribute_key", attributeKey), + resource.TestCheckResourceAttr(resourceName, "attribute_value", attributeValue), + ), + }, + { + Config: testAccAWSDynamoDbItemAttributeConfigBasic(tableName, hashKey, attributeKey, attributeValue2), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSDynamoDbTableItemAttributeExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "table_name", tableName), + resource.TestCheckResourceAttr(resourceName, "hash_key_value", "hashKeyValue"), + resource.TestCheckResourceAttr(resourceName, "range_key_value", ""), + resource.TestCheckResourceAttr(resourceName, "attribute_key", attributeKey), + resource.TestCheckResourceAttr(resourceName, "attribute_value", attributeValue2), + ), + }, + }, + }) +} + +func TestAccAWSDynamoDbTableItemAttribute_withRangeKey(t *testing.T) { + tableName := fmt.Sprintf("tf-acc-test-%s", acctest.RandString(8)) + hashKey := fmt.Sprintf("%s", acctest.RandString(8)) + rangeKey := fmt.Sprintf("%s", acctest.RandString(8)) + attributeKey := fmt.Sprintf("%s", acctest.RandString(8)) + attributeValue := fmt.Sprintf("%s", acctest.RandString(8)) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSDynamoDbItemAttributeDestroy(hashKey, rangeKey), + Steps: []resource.TestStep{ + { + Config: testAccAWSDynamoDbItemAttributeConfigWithRangeKey(tableName, hashKey, rangeKey, attributeKey, attributeValue), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSDynamoDbTableItemAttributeExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "table_name", tableName), + resource.TestCheckResourceAttr(resourceName, "hash_key_value", "hashKeyValue"), + resource.TestCheckResourceAttr(resourceName, "range_key_value", "rangeKeyValue"), + resource.TestCheckResourceAttr(resourceName, "attribute_key", attributeKey), + resource.TestCheckResourceAttr(resourceName, "attribute_value", attributeValue), + ), + }, + }, + }) +} + +func TestAccAWSDynamoDbTableItemAttribute_withRangeKey_update(t *testing.T) { + tableName := fmt.Sprintf("tf-acc-test-%s", acctest.RandString(8)) + hashKey := fmt.Sprintf("%s", acctest.RandString(8)) + rangeKey := fmt.Sprintf("%s", acctest.RandString(8)) + attributeKey := fmt.Sprintf("%s", acctest.RandString(8)) + attributeValue := fmt.Sprintf("%s", acctest.RandString(8)) + attributeValue2 := fmt.Sprintf("%s", acctest.RandString(8)) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSDynamoDbItemAttributeDestroy(hashKey, rangeKey), + Steps: []resource.TestStep{ + { + Config: testAccAWSDynamoDbItemAttributeConfigWithRangeKey(tableName, hashKey, rangeKey, attributeKey, attributeValue), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSDynamoDbTableItemAttributeExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "table_name", tableName), + resource.TestCheckResourceAttr(resourceName, "hash_key_value", "hashKeyValue"), + resource.TestCheckResourceAttr(resourceName, "range_key_value", "rangeKeyValue"), + resource.TestCheckResourceAttr(resourceName, "attribute_key", attributeKey), + resource.TestCheckResourceAttr(resourceName, "attribute_value", attributeValue), + ), + }, + { + Config: testAccAWSDynamoDbItemAttributeConfigWithRangeKey(tableName, hashKey, rangeKey, attributeKey, attributeValue2), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSDynamoDbTableItemAttributeExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "table_name", tableName), + resource.TestCheckResourceAttr(resourceName, "hash_key_value", "hashKeyValue"), + resource.TestCheckResourceAttr(resourceName, "range_key_value", "rangeKeyValue"), + resource.TestCheckResourceAttr(resourceName, "attribute_key", attributeKey), + resource.TestCheckResourceAttr(resourceName, "attribute_value", attributeValue2), + ), + }, + }, + }) +} + +func testAccCheckAWSDynamoDbItemAttributeDestroy(hashKeyName, rangeKeyName string) resource.TestCheckFunc { + return func(s *terraform.State) error { + conn := testAccProvider.Meta().(*AWSClient).dynamodbconn + + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_dynamodb_table_item_attribute" { + continue + } + + attrs := rs.Primary.Attributes + + result, err := conn.GetItem(&dynamodb.GetItemInput{ + ConsistentRead: aws.Bool(true), + ExpressionAttributeNames: map[string]*string{ + "#key": aws.String(attrs["attribute_key"]), + }, + Key: resourceAwsDynamoDbTableItemAttributeGetQueryKey(hashKeyName, attrs["hash_key_value"], rangeKeyName, attrs["range_key_value"]), + ProjectionExpression: aws.String("#key"), + TableName: aws.String(attrs["table_name"]), + }) + if err != nil { + if isAWSErr(err, dynamodb.ErrCodeResourceNotFoundException, "") { + return nil + } + return fmt.Errorf("Error retrieving DynamoDB table item: %s", err) + } + if result.Item == nil { + return nil + } + + return fmt.Errorf("DynamoDB table item attribute %s still exists", rs.Primary.ID) + } + + return nil + } +} + +func testAccCheckAWSDynamoDbTableItemAttributeExists(n string) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("Not found: %s", n) + } + + if rs.Primary.ID == "" { + return fmt.Errorf("No DynamoDB table item ID specified") + } + + conn := testAccProvider.Meta().(*AWSClient).dynamodbconn + + attrs := rs.Primary.Attributes + + hashKeyName, rangeKeyName, err := resourceAwsDynamoDbTableItemAttributeGetKeysInfo(conn, attrs["table_name"]) + if err != nil { + return err + } + + result, err := conn.GetItem(&dynamodb.GetItemInput{ + ConsistentRead: aws.Bool(true), + ExpressionAttributeNames: map[string]*string{ + "#key": aws.String(attrs["attribute_key"]), + }, + Key: resourceAwsDynamoDbTableItemAttributeGetQueryKey(hashKeyName, attrs["hash_key_value"], rangeKeyName, attrs["range_key_value"]), + ProjectionExpression: aws.String("#key"), + TableName: aws.String(attrs["table_name"]), + }) + if err != nil { + return fmt.Errorf("Problem getting table item '%s': %s", rs.Primary.ID, err) + } + + expectedValue := attrs["attribute_value"] + gottenValue := *result.Item[attrs["attribute_key"]].S + if expectedValue != gottenValue { + return fmt.Errorf("Got attribute value: %s, Expected: %s", gottenValue, expectedValue) + } + + return nil + } +} + +func testAccAWSDynamoDbItemAttributeConfigBasic(tableName, hashKey, attributeKey, attributeValue string) string { + return fmt.Sprintf(` +resource "aws_dynamodb_table" "test" { + name = "%[1]s" + read_capacity = 10 + write_capacity = 10 + hash_key = "%[2]s" + + attribute { + name = "%[2]s" + type = "S" + } +} + +resource "aws_dynamodb_table_item" "test" { + table_name = "${aws_dynamodb_table.test.name}" + hash_key = "${aws_dynamodb_table.test.hash_key}" + item = < Date: Fri, 28 Sep 2018 23:08:07 -0400 Subject: [PATCH 09/36] Add docs for dynamodb_table_item_attribute --- website/aws.erb | 4 ++ ...ynamodb_table_item_attribute.html.markdown | 69 +++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 website/docs/r/dynamodb_table_item_attribute.html.markdown diff --git a/website/aws.erb b/website/aws.erb index f9cf6b4ce42b..5aa77e2615dd 100644 --- a/website/aws.erb +++ b/website/aws.erb @@ -857,6 +857,10 @@ aws_dynamodb_table_item + > + aws_dynamodb_table_item_attribute + + diff --git a/website/docs/r/dynamodb_table_item_attribute.html.markdown b/website/docs/r/dynamodb_table_item_attribute.html.markdown new file mode 100644 index 000000000000..96ca815dcca1 --- /dev/null +++ b/website/docs/r/dynamodb_table_item_attribute.html.markdown @@ -0,0 +1,69 @@ +--- +layout: "aws" +page_title: "AWS: dynamodb_table_item_attribute" +sidebar_current: "docs-aws-resource-dynamodb-table-item-attribute" +description: |- + Provides a DynamoDB table item attribute resource +--- + +# aws_dynamodb_table_item_attribute + +Provides a DynamoDB table item attribute resource. Only supports strings. + +-> **Note:** This resource is not meant to be used for managing large amounts of data in your table, it is not designed to scale. + You should perform **regular backups** of all data in the table, see [AWS docs for more](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/BackupRestore.html). + +## Example Usage + +```hcl +resource "aws_dynamodb_table_item_attribute" "example" { + table_name = "${aws_dynamodb_table.example.name}" + hash_key_value = "something" + attribute_key = "five" + attribute_value = "55555" +} + +resource "aws_dynamodb_table_item" "example" { + table_name = "${aws_dynamodb_table.example.name}" + hash_key = "${aws_dynamodb_table.example.hash_key}" + item = < Date: Fri, 28 Sep 2018 23:21:22 -0400 Subject: [PATCH 10/36] Add import for dynamodb_table_item_attribute --- aws/resource_aws_dynamodb_table_item_attribute.go | 3 +++ ...esource_aws_dynamodb_table_item_attribute_test.go | 10 ++++++++++ .../r/dynamodb_table_item_attribute.html.markdown | 12 +++++++++++- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/aws/resource_aws_dynamodb_table_item_attribute.go b/aws/resource_aws_dynamodb_table_item_attribute.go index add08ecf6600..87155591ea7d 100644 --- a/aws/resource_aws_dynamodb_table_item_attribute.go +++ b/aws/resource_aws_dynamodb_table_item_attribute.go @@ -21,6 +21,9 @@ func resourceAwsDynamoDbTableItemAttribute() *schema.Resource { Read: resourceAwsDynamoDbTableItemAttributeRead, Update: resourceAwsDynamoDbTableItemAttributeUpdate, Delete: resourceAwsDynamoDbTableItemAttributeDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, Schema: map[string]*schema.Schema{ "table_name": { diff --git a/aws/resource_aws_dynamodb_table_item_attribute_test.go b/aws/resource_aws_dynamodb_table_item_attribute_test.go index 1ebbd52c3bfd..07941aa80d4a 100644 --- a/aws/resource_aws_dynamodb_table_item_attribute_test.go +++ b/aws/resource_aws_dynamodb_table_item_attribute_test.go @@ -34,6 +34,11 @@ func TestAccAWSDynamoDbTableItemAttribute_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "attribute_value", attributeValue), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -99,6 +104,11 @@ func TestAccAWSDynamoDbTableItemAttribute_withRangeKey(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "attribute_value", attributeValue), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } diff --git a/website/docs/r/dynamodb_table_item_attribute.html.markdown b/website/docs/r/dynamodb_table_item_attribute.html.markdown index 96ca815dcca1..784334c8c3bf 100644 --- a/website/docs/r/dynamodb_table_item_attribute.html.markdown +++ b/website/docs/r/dynamodb_table_item_attribute.html.markdown @@ -66,4 +66,14 @@ All of the arguments above are exported as attributes. ## Import -DynamoDB table items cannot be imported. +DynamoDB table item attributes can be imported using the table name, hash key value, range key value and attribute key, e.g. + +Without a range key: +``` +$ terraform import aws_dynamodb_table_item_attribute.example table_name:hash_key_value::attribute_key +``` + +With a range key: +``` +$ terraform import aws_dynamodb_table_item_attribute.example table_name:hash_key_value:range_key_value:attribute_key +``` From 3e4f87de8898fd8b32de5e2a46acba3b5fb4a0e6 Mon Sep 17 00:00:00 2001 From: Julien Duchesne Date: Thu, 8 Aug 2019 13:31:38 -0400 Subject: [PATCH 11/36] Coveo Deployment Changes --- .gitignore | 2 ++ .goreleaser.yml | 21 +++++++++++++++++++++ .travis.yml | 9 ++++++--- 3 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 .goreleaser.yml diff --git a/.gitignore b/.gitignore index 53849c06c323..6e552a997568 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,5 @@ website/vendor *.winfile eol=crlf /.vs node_modules + +dist \ No newline at end of file diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 000000000000..d33fd857c8a4 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,21 @@ +# Build customization +builds: + - binary: terraform-provider-aws + goos: + - windows + - darwin + - linux + goarch: + - amd64 + +# Archive customization +archive: + format: zip + + replacements: + amd64: 64-bits + 386: 32-bits + darwin: macOS + + files: + - nothing.* \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index f575bd7eae30..5d5f6dbfb899 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,7 @@ sudo: required services: - docker language: go +go_import_path: github.com/terraform-providers/terraform-provider-aws env: global: @@ -33,6 +34,8 @@ install: - bash scripts/gogetcookie.sh - make tools -branches: - only: - - master +after_success: +- if [ ${TRAVIS_TAG::1} = v ]; + then + curl -sL https://git.io/goreleaser | bash; + fi \ No newline at end of file From d02d2d802a2e720a06116206f59ca52f91540616 Mon Sep 17 00:00:00 2001 From: Julien Duchesne Date: Mon, 9 Sep 2019 14:21:20 -0400 Subject: [PATCH 12/36] Add retry for lambda update conflict --- aws/resource_aws_lambda_function.go | 36 ++++++++++++++++++----------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/aws/resource_aws_lambda_function.go b/aws/resource_aws_lambda_function.go index 7d1e64055a2c..c4e7e57729ff 100644 --- a/aws/resource_aws_lambda_function.go +++ b/aws/resource_aws_lambda_function.go @@ -394,19 +394,23 @@ func resourceAwsLambdaFunctionCreate(d *schema.ResourceData, meta interface{}) e if err != nil { log.Printf("[DEBUG] Error creating Lambda Function: %s", err) - if isAWSErr(err, "InvalidParameterValueException", "The role defined for the function cannot be assumed by Lambda") { + if isAWSErr(err, lambda.ErrCodeInvalidParameterValueException, "The role defined for the function cannot be assumed by Lambda") { log.Printf("[DEBUG] Received %s, retrying CreateFunction", err) return resource.RetryableError(err) } - if isAWSErr(err, "InvalidParameterValueException", "The provided execution role does not have permissions") { + if isAWSErr(err, lambda.ErrCodeInvalidParameterValueException, "The provided execution role does not have permissions") { log.Printf("[DEBUG] Received %s, retrying CreateFunction", err) return resource.RetryableError(err) } - if isAWSErr(err, "InvalidParameterValueException", "Your request has been throttled by EC2") { + if isAWSErr(err, lambda.ErrCodeInvalidParameterValueException, "Your request has been throttled by EC2") { log.Printf("[DEBUG] Received %s, retrying CreateFunction", err) return resource.RetryableError(err) } - if isAWSErr(err, "InvalidParameterValueException", "Lambda was unable to configure access to your environment variables because the KMS key is invalid for CreateGrant") { + if isAWSErr(err, lambda.ErrCodeInvalidParameterValueException, "Lambda was unable to configure access to your environment variables because the KMS key is invalid for CreateGrant") { + log.Printf("[DEBUG] Received %s, retrying CreateFunction", err) + return resource.RetryableError(err) + } + if isAWSErr(err, lambda.ErrCodeResourceConflictException, "") { log.Printf("[DEBUG] Received %s, retrying CreateFunction", err) return resource.RetryableError(err) } @@ -416,7 +420,7 @@ func resourceAwsLambdaFunctionCreate(d *schema.ResourceData, meta interface{}) e return nil }) if err != nil { - if !isResourceTimeoutError(err) && !isAWSErr(err, "InvalidParameterValueException", "Your request has been throttled by EC2") { + if !isResourceTimeoutError(err) && !isAWSErr(err, lambda.ErrCodeInvalidParameterValueException, "Your request has been throttled by EC2") { return fmt.Errorf("Error creating Lambda function: %s", err) } // Allow additional time for slower uploads or EC2 throttling @@ -425,7 +429,7 @@ func resourceAwsLambdaFunctionCreate(d *schema.ResourceData, meta interface{}) e if err != nil { log.Printf("[DEBUG] Error creating Lambda Function: %s", err) - if isAWSErr(err, "InvalidParameterValueException", "Your request has been throttled by EC2") { + if isAWSErr(err, lambda.ErrCodeInvalidParameterValueException, "Your request has been throttled by EC2") { log.Printf("[DEBUG] Received %s, retrying CreateFunction", err) return resource.RetryableError(err) } @@ -494,7 +498,7 @@ func resourceAwsLambdaFunctionRead(d *schema.ResourceData, meta interface{}) err getFunctionOutput, err := conn.GetFunction(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "ResourceNotFoundException" && !d.IsNewResource() { + if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == lambda.ErrCodeResourceNotFoundException && !d.IsNewResource() { d.SetId("") return nil } @@ -769,20 +773,24 @@ func resourceAwsLambdaFunctionUpdate(d *schema.ResourceData, meta interface{}) e if err != nil { log.Printf("[DEBUG] Received error modifying Lambda Function Configuration %s: %s", d.Id(), err) - if isAWSErr(err, "InvalidParameterValueException", "The role defined for the function cannot be assumed by Lambda") { + if isAWSErr(err, lambda.ErrCodeInvalidParameterValueException, "The role defined for the function cannot be assumed by Lambda") { log.Printf("[DEBUG] Received %s, retrying UpdateFunctionConfiguration", err) return resource.RetryableError(err) } - if isAWSErr(err, "InvalidParameterValueException", "The provided execution role does not have permissions") { + if isAWSErr(err, lambda.ErrCodeInvalidParameterValueException, "The provided execution role does not have permissions") { log.Printf("[DEBUG] Received %s, retrying UpdateFunctionConfiguration", err) return resource.RetryableError(err) } - if isAWSErr(err, "InvalidParameterValueException", "Your request has been throttled by EC2, please make sure you have enough API rate limit.") { + if isAWSErr(err, lambda.ErrCodeInvalidParameterValueException, "Your request has been throttled by EC2, please make sure you have enough API rate limit.") { log.Printf("[DEBUG] Received %s, retrying UpdateFunctionConfiguration", err) return resource.RetryableError(err) } - if isAWSErr(err, "InvalidParameterValueException", "Lambda was unable to configure access to your environment variables because the KMS key is invalid for CreateGrant") { - log.Printf("[DEBUG] Received %s, retrying CreateFunction", err) + if isAWSErr(err, lambda.ErrCodeInvalidParameterValueException, "Lambda was unable to configure access to your environment variables because the KMS key is invalid for CreateGrant") { + log.Printf("[DEBUG] Received %s, retrying UpdateFunctionConfiguration", err) + return resource.RetryableError(err) + } + if isAWSErr(err, lambda.ErrCodeResourceConflictException, "") { + log.Printf("[DEBUG] Received %s, retrying UpdateFunctionConfiguration", err) return resource.RetryableError(err) } @@ -791,7 +799,7 @@ func resourceAwsLambdaFunctionUpdate(d *schema.ResourceData, meta interface{}) e return nil }) if err != nil { - if !isAWSErr(err, "InvalidParameterValueException", "Your request has been throttled by EC2, please make sure you have enough API rate limit.") { + if !isAWSErr(err, lambda.ErrCodeInvalidParameterValueException, "Your request has been throttled by EC2, please make sure you have enough API rate limit.") { return fmt.Errorf("Error modifying Lambda Function Configuration %s: %s", d.Id(), err) } // Allow 9 more minutes for EC2 throttling @@ -800,7 +808,7 @@ func resourceAwsLambdaFunctionUpdate(d *schema.ResourceData, meta interface{}) e if err != nil { log.Printf("[DEBUG] Received error modifying Lambda Function Configuration %s: %s", d.Id(), err) - if isAWSErr(err, "InvalidParameterValueException", "Your request has been throttled by EC2, please make sure you have enough API rate limit.") { + if isAWSErr(err, lambda.ErrCodeInvalidParameterValueException, "Your request has been throttled by EC2, please make sure you have enough API rate limit.") { log.Printf("[DEBUG] Received %s, retrying UpdateFunctionConfiguration", err) return resource.RetryableError(err) } From 42d81cb8e1d943bff081f9c045a04155ec536f1c Mon Sep 17 00:00:00 2001 From: Julien Duchesne Date: Mon, 9 Sep 2019 14:21:20 -0400 Subject: [PATCH 13/36] Add retry for lambda update conflict --- aws/resource_aws_lambda_function.go | 36 ++++++++++++++++++----------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/aws/resource_aws_lambda_function.go b/aws/resource_aws_lambda_function.go index 7d1e64055a2c..c4e7e57729ff 100644 --- a/aws/resource_aws_lambda_function.go +++ b/aws/resource_aws_lambda_function.go @@ -394,19 +394,23 @@ func resourceAwsLambdaFunctionCreate(d *schema.ResourceData, meta interface{}) e if err != nil { log.Printf("[DEBUG] Error creating Lambda Function: %s", err) - if isAWSErr(err, "InvalidParameterValueException", "The role defined for the function cannot be assumed by Lambda") { + if isAWSErr(err, lambda.ErrCodeInvalidParameterValueException, "The role defined for the function cannot be assumed by Lambda") { log.Printf("[DEBUG] Received %s, retrying CreateFunction", err) return resource.RetryableError(err) } - if isAWSErr(err, "InvalidParameterValueException", "The provided execution role does not have permissions") { + if isAWSErr(err, lambda.ErrCodeInvalidParameterValueException, "The provided execution role does not have permissions") { log.Printf("[DEBUG] Received %s, retrying CreateFunction", err) return resource.RetryableError(err) } - if isAWSErr(err, "InvalidParameterValueException", "Your request has been throttled by EC2") { + if isAWSErr(err, lambda.ErrCodeInvalidParameterValueException, "Your request has been throttled by EC2") { log.Printf("[DEBUG] Received %s, retrying CreateFunction", err) return resource.RetryableError(err) } - if isAWSErr(err, "InvalidParameterValueException", "Lambda was unable to configure access to your environment variables because the KMS key is invalid for CreateGrant") { + if isAWSErr(err, lambda.ErrCodeInvalidParameterValueException, "Lambda was unable to configure access to your environment variables because the KMS key is invalid for CreateGrant") { + log.Printf("[DEBUG] Received %s, retrying CreateFunction", err) + return resource.RetryableError(err) + } + if isAWSErr(err, lambda.ErrCodeResourceConflictException, "") { log.Printf("[DEBUG] Received %s, retrying CreateFunction", err) return resource.RetryableError(err) } @@ -416,7 +420,7 @@ func resourceAwsLambdaFunctionCreate(d *schema.ResourceData, meta interface{}) e return nil }) if err != nil { - if !isResourceTimeoutError(err) && !isAWSErr(err, "InvalidParameterValueException", "Your request has been throttled by EC2") { + if !isResourceTimeoutError(err) && !isAWSErr(err, lambda.ErrCodeInvalidParameterValueException, "Your request has been throttled by EC2") { return fmt.Errorf("Error creating Lambda function: %s", err) } // Allow additional time for slower uploads or EC2 throttling @@ -425,7 +429,7 @@ func resourceAwsLambdaFunctionCreate(d *schema.ResourceData, meta interface{}) e if err != nil { log.Printf("[DEBUG] Error creating Lambda Function: %s", err) - if isAWSErr(err, "InvalidParameterValueException", "Your request has been throttled by EC2") { + if isAWSErr(err, lambda.ErrCodeInvalidParameterValueException, "Your request has been throttled by EC2") { log.Printf("[DEBUG] Received %s, retrying CreateFunction", err) return resource.RetryableError(err) } @@ -494,7 +498,7 @@ func resourceAwsLambdaFunctionRead(d *schema.ResourceData, meta interface{}) err getFunctionOutput, err := conn.GetFunction(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "ResourceNotFoundException" && !d.IsNewResource() { + if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == lambda.ErrCodeResourceNotFoundException && !d.IsNewResource() { d.SetId("") return nil } @@ -769,20 +773,24 @@ func resourceAwsLambdaFunctionUpdate(d *schema.ResourceData, meta interface{}) e if err != nil { log.Printf("[DEBUG] Received error modifying Lambda Function Configuration %s: %s", d.Id(), err) - if isAWSErr(err, "InvalidParameterValueException", "The role defined for the function cannot be assumed by Lambda") { + if isAWSErr(err, lambda.ErrCodeInvalidParameterValueException, "The role defined for the function cannot be assumed by Lambda") { log.Printf("[DEBUG] Received %s, retrying UpdateFunctionConfiguration", err) return resource.RetryableError(err) } - if isAWSErr(err, "InvalidParameterValueException", "The provided execution role does not have permissions") { + if isAWSErr(err, lambda.ErrCodeInvalidParameterValueException, "The provided execution role does not have permissions") { log.Printf("[DEBUG] Received %s, retrying UpdateFunctionConfiguration", err) return resource.RetryableError(err) } - if isAWSErr(err, "InvalidParameterValueException", "Your request has been throttled by EC2, please make sure you have enough API rate limit.") { + if isAWSErr(err, lambda.ErrCodeInvalidParameterValueException, "Your request has been throttled by EC2, please make sure you have enough API rate limit.") { log.Printf("[DEBUG] Received %s, retrying UpdateFunctionConfiguration", err) return resource.RetryableError(err) } - if isAWSErr(err, "InvalidParameterValueException", "Lambda was unable to configure access to your environment variables because the KMS key is invalid for CreateGrant") { - log.Printf("[DEBUG] Received %s, retrying CreateFunction", err) + if isAWSErr(err, lambda.ErrCodeInvalidParameterValueException, "Lambda was unable to configure access to your environment variables because the KMS key is invalid for CreateGrant") { + log.Printf("[DEBUG] Received %s, retrying UpdateFunctionConfiguration", err) + return resource.RetryableError(err) + } + if isAWSErr(err, lambda.ErrCodeResourceConflictException, "") { + log.Printf("[DEBUG] Received %s, retrying UpdateFunctionConfiguration", err) return resource.RetryableError(err) } @@ -791,7 +799,7 @@ func resourceAwsLambdaFunctionUpdate(d *schema.ResourceData, meta interface{}) e return nil }) if err != nil { - if !isAWSErr(err, "InvalidParameterValueException", "Your request has been throttled by EC2, please make sure you have enough API rate limit.") { + if !isAWSErr(err, lambda.ErrCodeInvalidParameterValueException, "Your request has been throttled by EC2, please make sure you have enough API rate limit.") { return fmt.Errorf("Error modifying Lambda Function Configuration %s: %s", d.Id(), err) } // Allow 9 more minutes for EC2 throttling @@ -800,7 +808,7 @@ func resourceAwsLambdaFunctionUpdate(d *schema.ResourceData, meta interface{}) e if err != nil { log.Printf("[DEBUG] Received error modifying Lambda Function Configuration %s: %s", d.Id(), err) - if isAWSErr(err, "InvalidParameterValueException", "Your request has been throttled by EC2, please make sure you have enough API rate limit.") { + if isAWSErr(err, lambda.ErrCodeInvalidParameterValueException, "Your request has been throttled by EC2, please make sure you have enough API rate limit.") { log.Printf("[DEBUG] Received %s, retrying UpdateFunctionConfiguration", err) return resource.RetryableError(err) } From 9cc7e9fef9a6c5511bb5b11d9993102a94964c90 Mon Sep 17 00:00:00 2001 From: Julien Duchesne Date: Fri, 27 Sep 2019 09:07:51 -0400 Subject: [PATCH 14/36] Add data source to download a s3 bucket object --- ...ta_source_aws_s3_download_bucket_object.go | 76 +++++++++++++++++ ...urce_aws_s3_download_bucket_object_test.go | 82 +++++++++++++++++++ aws/provider.go | 1 + website/aws.erb | 3 + .../d/s3_download_bucket_object.html.markdown | 42 ++++++++++ 5 files changed, 204 insertions(+) create mode 100644 aws/data_source_aws_s3_download_bucket_object.go create mode 100644 aws/data_source_aws_s3_download_bucket_object_test.go create mode 100644 website/docs/d/s3_download_bucket_object.html.markdown diff --git a/aws/data_source_aws_s3_download_bucket_object.go b/aws/data_source_aws_s3_download_bucket_object.go new file mode 100644 index 000000000000..36656b3f36f1 --- /dev/null +++ b/aws/data_source_aws_s3_download_bucket_object.go @@ -0,0 +1,76 @@ +package aws + +import ( + "fmt" + "io/ioutil" + "log" + "os" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/s3" + "github.com/hashicorp/terraform/helper/schema" +) + +func dataSourceAwsS3DownloadBucketObject() *schema.Resource { + return &schema.Resource{ + Read: dataSourceAwsS3DownloadBucketObjectRead, + + Schema: map[string]*schema.Schema{ + "bucket": { + Type: schema.TypeString, + Required: true, + }, + "key": { + Type: schema.TypeString, + Required: true, + }, + "version_id": { + Type: schema.TypeString, + Optional: true, + }, + "filename": { + Type: schema.TypeString, + Required: true, + }, + }, + } +} + +func dataSourceAwsS3DownloadBucketObjectRead(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).s3conn + + bucket := d.Get("bucket").(string) + key := d.Get("key").(string) + uniqueID := bucket + "/" + key + + input := s3.GetObjectInput{ + Bucket: aws.String(bucket), + Key: aws.String(key), + } + if v, ok := d.GetOk("version_id"); ok { + input.VersionId = aws.String(v.(string)) + } + out, err := conn.GetObject(&input) + if err != nil { + return fmt.Errorf("Failed getting S3 object: %s", err) + } + + s3ObjectBytes, err := ioutil.ReadAll(out.Body) + if err != nil { + return fmt.Errorf("Failed reading content of S3 object (%s): %s", uniqueID, err) + } + log.Printf("[INFO] Saving %d bytes from S3 object %s", len(s3ObjectBytes), uniqueID) + + fileName := d.Get("filename").(string) + file, err := os.Create(fileName) + defer file.Close() + if err != nil { + return fmt.Errorf("Failed to create a file at %s: %s", fileName, err) + } + + if _, err = file.Write(s3ObjectBytes); err != nil { + return fmt.Errorf("Error writing content from s3://%s to %s: %s", uniqueID, fileName, err) + } + + return nil +} diff --git a/aws/data_source_aws_s3_download_bucket_object_test.go b/aws/data_source_aws_s3_download_bucket_object_test.go new file mode 100644 index 000000000000..6231f0ba6f8d --- /dev/null +++ b/aws/data_source_aws_s3_download_bucket_object_test.go @@ -0,0 +1,82 @@ +package aws + +import ( + "fmt" + "github.com/aws/aws-sdk-go/service/s3" + "github.com/hashicorp/terraform/helper/acctest" + "github.com/hashicorp/terraform/helper/resource" + "github.com/hashicorp/terraform/terraform" + "io/ioutil" + "path" + "testing" +) + +func TestAccDataSourceAWSS3DownloadBucketObject_basic(t *testing.T) { + dirName, _ := ioutil.TempDir("", "") + fileName := path.Join(dirName, "testfile.txt") + rInt := acctest.RandInt() + resourceOnlyConf, conf := testAccAWSDataSourceS3DownloadObjectConfig_basic(rInt, fileName) + + var rObj s3.GetObjectOutput + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + PreventPostDestroyRefresh: true, + Steps: []resource.TestStep{ + { + Config: resourceOnlyConf, + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSS3BucketObjectExists("aws_s3_bucket_object.object", &rObj), + ), + }, + { + Config: conf, + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsS3DownloadedObjectExists(fileName, "Hello World"), + ), + }, + }, + }) +} + +func testAccCheckAwsS3DownloadedObjectExists(fileName string, expectedContent string) resource.TestCheckFunc { + return func(s *terraform.State) error { + content, err := ioutil.ReadFile(fileName) + if err != nil { + return fmt.Errorf("Error while reading the downloaded file: %s", err) + } + + gottenContent := string(content) + if gottenContent != expectedContent { + return fmt.Errorf("Gotten content was `%s`, not `%s` as expected", gottenContent, expectedContent) + } + + return nil + + } + +} + +func testAccAWSDataSourceS3DownloadObjectConfig_basic(randInt int, fileName string) (string, string) { + resources := fmt.Sprintf(` +resource "aws_s3_bucket" "object_bucket" { + bucket = "tf-object-test-bucket-%d" +} +resource "aws_s3_bucket_object" "object" { + bucket = "${aws_s3_bucket.object_bucket.bucket}" + key = "tf-testing-obj-%d" + content = "Hello World" +} +`, randInt, randInt) + + both := fmt.Sprintf(`%s +data "aws_s3_download_bucket_object" "obj" { + bucket = "tf-object-test-bucket-%d" + key = "tf-testing-obj-%d" + filename = "%s" +} +`, resources, randInt, randInt, fileName) + + return resources, both +} diff --git a/aws/provider.go b/aws/provider.go index 93fabe9c30b2..9a78757bb62e 100644 --- a/aws/provider.go +++ b/aws/provider.go @@ -256,6 +256,7 @@ func Provider() terraform.ResourceProvider { "aws_s3_bucket": dataSourceAwsS3Bucket(), "aws_s3_bucket_object": dataSourceAwsS3BucketObject(), "aws_s3_bucket_objects": dataSourceAwsS3BucketObjects(), + "aws_s3_download_bucket_object": dataSourceAwsS3DownloadBucketObject(), "aws_secretsmanager_secret": dataSourceAwsSecretsManagerSecret(), "aws_secretsmanager_secret_version": dataSourceAwsSecretsManagerSecretVersion(), "aws_servicequotas_service": dataSourceAwsServiceQuotasService(), diff --git a/website/aws.erb b/website/aws.erb index 8b880c6a1b07..aa1a3ebc0f55 100644 --- a/website/aws.erb +++ b/website/aws.erb @@ -2495,6 +2495,9 @@
  • aws_s3_bucket_objects
  • +
  • + aws_s3_download_bucket_object +
  • diff --git a/website/docs/d/s3_download_bucket_object.html.markdown b/website/docs/d/s3_download_bucket_object.html.markdown new file mode 100644 index 000000000000..86d3fdefe27f --- /dev/null +++ b/website/docs/d/s3_download_bucket_object.html.markdown @@ -0,0 +1,42 @@ +--- +layout: "aws" +page_title: "AWS: aws_s3_download_bucket_object" +sidebar_current: "docs-aws-datasource-s3-download-bucket-object" +description: |- + Downloads a bucket object to be used as a local file +--- + +# Data Source: aws_s3_download_bucket_object + +The S3 Download Bucket Object Data Source allows download of a file to the disk to be used as a local file. + +## Example Usage + +The following example retrieves a text object (which must have a `Content-Type` +value starting with `text/`) and uses it as the `user_data` for an EC2 instance: + +```hcl +data "aws_s3_download_bucket_object" "lambda_file" { + bucket = "ourcorp-deploy-config" + key = "lambda_file.zip" + filename = "lambda_file.zip" +} + +resource "aws_lambda_function" "example" { + filename = "lambda_file.zip" + function_name = "example" + handler = "lambda_handler.lambda_handler" + runtime = "python3.7" +} +``` + +This is especially useful when using a S3 file to deploy a Lambda function in multiple regions. Deployment from S3 can only occur in the same region as the lambda. + +## Argument Reference + +The following arguments are supported: + +* `bucket` - (Required) The name of the bucket to read the object from +* `key` - (Required) The full path to the object inside the bucket +* `version_id` - (Optional) Specific version ID of the object returned (defaults to latest version) +* `filename` - (Required) The path where the file should be downloaded From 14d79a5552a35dc17ecd10b72bcc00e685c524ea Mon Sep 17 00:00:00 2001 From: Julien Duchesne Date: Fri, 27 Sep 2019 09:19:02 -0400 Subject: [PATCH 15/36] Check for error before defer file.Close() --- aws/data_source_aws_s3_download_bucket_object.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/data_source_aws_s3_download_bucket_object.go b/aws/data_source_aws_s3_download_bucket_object.go index 36656b3f36f1..440eb6c95767 100644 --- a/aws/data_source_aws_s3_download_bucket_object.go +++ b/aws/data_source_aws_s3_download_bucket_object.go @@ -63,10 +63,10 @@ func dataSourceAwsS3DownloadBucketObjectRead(d *schema.ResourceData, meta interf fileName := d.Get("filename").(string) file, err := os.Create(fileName) - defer file.Close() if err != nil { return fmt.Errorf("Failed to create a file at %s: %s", fileName, err) } + defer file.Close() if _, err = file.Write(s3ObjectBytes); err != nil { return fmt.Errorf("Error writing content from s3://%s to %s: %s", uniqueID, fileName, err) From 316f87bf1e9adce4c832b1f9cd9fc3de3ab77df9 Mon Sep 17 00:00:00 2001 From: Julien Duchesne Date: Tue, 5 Nov 2019 09:36:27 -0500 Subject: [PATCH 16/36] Move to plugin SDK --- aws/data_source_aws_s3_download_bucket_object.go | 2 +- aws/data_source_aws_s3_download_bucket_object_test.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/aws/data_source_aws_s3_download_bucket_object.go b/aws/data_source_aws_s3_download_bucket_object.go index 440eb6c95767..fe924ec88cf4 100644 --- a/aws/data_source_aws_s3_download_bucket_object.go +++ b/aws/data_source_aws_s3_download_bucket_object.go @@ -8,7 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/s3" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) func dataSourceAwsS3DownloadBucketObject() *schema.Resource { diff --git a/aws/data_source_aws_s3_download_bucket_object_test.go b/aws/data_source_aws_s3_download_bucket_object_test.go index 6231f0ba6f8d..5aeb39edff8c 100644 --- a/aws/data_source_aws_s3_download_bucket_object_test.go +++ b/aws/data_source_aws_s3_download_bucket_object_test.go @@ -3,9 +3,9 @@ package aws import ( "fmt" "github.com/aws/aws-sdk-go/service/s3" - "github.com/hashicorp/terraform/helper/acctest" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/terraform" + "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/terraform" "io/ioutil" "path" "testing" From f6fb41aa72f5eba00466c3a7fb94ed24c52b2b46 Mon Sep 17 00:00:00 2001 From: Julien Duchesne Date: Tue, 5 Nov 2019 09:39:07 -0500 Subject: [PATCH 17/36] Move to plugin SDK --- aws/resource_aws_dynamodb_table_item_attribute.go | 2 +- aws/resource_aws_dynamodb_table_item_attribute_test.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/aws/resource_aws_dynamodb_table_item_attribute.go b/aws/resource_aws_dynamodb_table_item_attribute.go index 87155591ea7d..04270cc46b10 100644 --- a/aws/resource_aws_dynamodb_table_item_attribute.go +++ b/aws/resource_aws_dynamodb_table_item_attribute.go @@ -7,7 +7,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/dynamodb" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) const ( diff --git a/aws/resource_aws_dynamodb_table_item_attribute_test.go b/aws/resource_aws_dynamodb_table_item_attribute_test.go index ece29465a5ed..517f6a707193 100644 --- a/aws/resource_aws_dynamodb_table_item_attribute_test.go +++ b/aws/resource_aws_dynamodb_table_item_attribute_test.go @@ -4,9 +4,9 @@ import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/dynamodb" - "github.com/hashicorp/terraform/helper/acctest" - "github.com/hashicorp/terraform/helper/resource" - "github.com/hashicorp/terraform/terraform" + "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/terraform" "testing" ) From ba070a794d0f75dfd1551fdd8e916cd7066532c0 Mon Sep 17 00:00:00 2001 From: Julien Duchesne Date: Tue, 3 Dec 2019 10:06:29 -0500 Subject: [PATCH 18/36] Remove website lint. We don't care about that --- .travis.yml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 489b1989a28d..cbc1835c358c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,18 +19,12 @@ matrix: - go: "1.13.x" name: "Code UnitTest" script: make test - - go: "1.13.x" - name: "Website" - script: - - make docscheck - - make website-test - - make website-lint install: - make tools after_success: -- if [ ${TRAVIS_TAG::1} = v ]; - then + - if [ ${TRAVIS_TAG::1} = v ]; + then curl -sL https://git.io/goreleaser | bash; - fi \ No newline at end of file + fi From 89c3672609ceaefd2855dee2bd229a770a6bf20e Mon Sep 17 00:00:00 2001 From: Jo Giroux Date: Sun, 9 Feb 2020 11:41:45 -0500 Subject: [PATCH 19/36] Update goreleaser config The configuration for archive now support multiple archives, we have to change the archive to archives and make it a list --- .goreleaser.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index d33fd857c8a4..4600de21a243 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -9,13 +9,13 @@ builds: - amd64 # Archive customization -archive: - format: zip +archives: + - format: zip - replacements: - amd64: 64-bits - 386: 32-bits - darwin: macOS + replacements: + amd64: 64-bits + 386: 32-bits + darwin: macOS - files: - - nothing.* \ No newline at end of file + files: + - nothing.* From e07833151e022b154f9b674cfb622fdd527baaaa Mon Sep 17 00:00:00 2001 From: Julien Duchesne Date: Thu, 23 Apr 2020 07:25:40 -0400 Subject: [PATCH 20/36] Add check to verify that attributes are set Fix documentation --- aws/data_source_aws_s3_download_bucket_object.go | 3 +++ aws/data_source_aws_s3_download_bucket_object_test.go | 8 +++++--- website/docs/d/s3_download_bucket_object.html.markdown | 7 +++---- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/aws/data_source_aws_s3_download_bucket_object.go b/aws/data_source_aws_s3_download_bucket_object.go index fe924ec88cf4..73dd7505742d 100644 --- a/aws/data_source_aws_s3_download_bucket_object.go +++ b/aws/data_source_aws_s3_download_bucket_object.go @@ -72,5 +72,8 @@ func dataSourceAwsS3DownloadBucketObjectRead(d *schema.ResourceData, meta interf return fmt.Errorf("Error writing content from s3://%s to %s: %s", uniqueID, fileName, err) } + d.SetId(fileName) + d.Set("version_id", out.VersionId) + return nil } diff --git a/aws/data_source_aws_s3_download_bucket_object_test.go b/aws/data_source_aws_s3_download_bucket_object_test.go index 5aeb39edff8c..7c3a182020c9 100644 --- a/aws/data_source_aws_s3_download_bucket_object_test.go +++ b/aws/data_source_aws_s3_download_bucket_object_test.go @@ -2,13 +2,14 @@ package aws import ( "fmt" + "io/ioutil" + "path" + "testing" + "github.com/aws/aws-sdk-go/service/s3" "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" - "io/ioutil" - "path" - "testing" ) func TestAccDataSourceAWSS3DownloadBucketObject_basic(t *testing.T) { @@ -34,6 +35,7 @@ func TestAccDataSourceAWSS3DownloadBucketObject_basic(t *testing.T) { Config: conf, Check: resource.ComposeTestCheckFunc( testAccCheckAwsS3DownloadedObjectExists(fileName, "Hello World"), + resource.TestCheckResourceAttr("data.aws_s3_download_bucket_object.obj", "filename", fileName), ), }, }, diff --git a/website/docs/d/s3_download_bucket_object.html.markdown b/website/docs/d/s3_download_bucket_object.html.markdown index 86d3fdefe27f..2e8b6aa3facf 100644 --- a/website/docs/d/s3_download_bucket_object.html.markdown +++ b/website/docs/d/s3_download_bucket_object.html.markdown @@ -1,7 +1,7 @@ --- +subcategory: "S3" layout: "aws" page_title: "AWS: aws_s3_download_bucket_object" -sidebar_current: "docs-aws-datasource-s3-download-bucket-object" description: |- Downloads a bucket object to be used as a local file --- @@ -12,8 +12,7 @@ The S3 Download Bucket Object Data Source allows download of a file to the disk ## Example Usage -The following example retrieves a text object (which must have a `Content-Type` -value starting with `text/`) and uses it as the `user_data` for an EC2 instance: +The following example retrieves a zip file from S3 and uses that file for a Lambda function ```hcl data "aws_s3_download_bucket_object" "lambda_file" { @@ -23,7 +22,7 @@ data "aws_s3_download_bucket_object" "lambda_file" { } resource "aws_lambda_function" "example" { - filename = "lambda_file.zip" + filename = data.aws_s3_download_bucket_object.lambda_file.filename function_name = "example" handler = "lambda_handler.lambda_handler" runtime = "python3.7" From 55109bd1f7f6b36d2c94fe0f58be7a0a65ee1b2e Mon Sep 17 00:00:00 2001 From: Rajendra Raghavendra Date: Sun, 10 May 2020 20:13:42 -0500 Subject: [PATCH 21/36] support vpc config --- ...ce_aws_kinesis_firehose_delivery_stream.go | 74 ++++++ ...s_kinesis_firehose_delivery_stream_test.go | 231 ++++++++++++++++++ ...sis_firehose_delivery_stream.html.markdown | 7 + 3 files changed, 312 insertions(+) diff --git a/aws/resource_aws_kinesis_firehose_delivery_stream.go b/aws/resource_aws_kinesis_firehose_delivery_stream.go index 09b4b2e6fd4a..bbf22f93e33a 100644 --- a/aws/resource_aws_kinesis_firehose_delivery_stream.go +++ b/aws/resource_aws_kinesis_firehose_delivery_stream.go @@ -209,6 +209,7 @@ func flattenFirehoseElasticsearchConfiguration(description *firehose.Elasticsear "index_name": aws.StringValue(description.IndexName), "s3_backup_mode": aws.StringValue(description.S3BackupMode), "index_rotation_period": aws.StringValue(description.IndexRotationPeriod), + "vpc_config": flattenVpcConfiguration(description.VpcConfigurationDescription), "processing_configuration": flattenProcessingConfiguration(description.ProcessingConfiguration, aws.StringValue(description.RoleARN)), } @@ -224,6 +225,21 @@ func flattenFirehoseElasticsearchConfiguration(description *firehose.Elasticsear return []map[string]interface{}{m} } +func flattenVpcConfiguration(description *firehose.VpcConfigurationDescription) []map[string]interface{} { + if description == nil { + return []map[string]interface{}{} + } + + m := map[string]interface{}{ + "vpc_id": aws.StringValue(description.VpcId), + "subnet_ids": flattenStringList(description.SubnetIds), + "security_group_ids": flattenStringList(description.SecurityGroupIds), + "role_arn": aws.StringValue(description.RoleARN), + } + + return []map[string]interface{}{m} +} + func flattenFirehoseExtendedS3Configuration(description *firehose.ExtendedS3DestinationDescription) []map[string]interface{} { if description == nil { return []map[string]interface{}{} @@ -1275,6 +1291,37 @@ func resourceAwsKinesisFirehoseDeliveryStream() *schema.Resource { }, }, + "vpc_config": { + Type: schema.TypeList, + Optional: true, + ForceNew: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "vpc_id": { + Type: schema.TypeString, + Computed: true, + }, + "subnet_ids": { + Type: schema.TypeSet, + Required: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Set: schema.HashString, + }, + "security_group_ids": { + Type: schema.TypeSet, + Required: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Set: schema.HashString, + }, + "role_arn": { + Type: schema.TypeString, + Required: true, + }, + }, + }, + }, + "cloudwatch_logging_options": cloudWatchLoggingOptionsSchema(), "processing_configuration": processingConfigurationSchema(), @@ -1826,6 +1873,29 @@ func extractCloudWatchLoggingConfiguration(s3 map[string]interface{}) *firehose. } +func extractVpcConfiguration(es map[string]interface{}) *firehose.VpcConfiguration { + config := es["vpc_config"].([]interface{}) + if len(config) == 0 { + return nil + } + vpcConfig := config[0].(map[string]interface{}) + s := vpcConfig["subnet_ids"].(*schema.Set).List() + subnets := make([]string, len(s)) + for i, v := range s { + subnets[i] = fmt.Sprint(v) + } + sg := vpcConfig["security_group_ids"].(*schema.Set).List() + securityGroups := make([]string, len(sg)) + for i, v := range sg { + securityGroups[i] = fmt.Sprint(v) + } + return &firehose.VpcConfiguration{ + RoleARN: aws.String(vpcConfig["role_arn"].(string)), + SubnetIds: aws.StringSlice(subnets), + SecurityGroupIds: aws.StringSlice(securityGroups), + } +} + func extractPrefixConfiguration(s3 map[string]interface{}) *string { if v, ok := s3["prefix"]; ok { return aws.String(v.(string)) @@ -1934,6 +2004,10 @@ func createElasticsearchConfig(d *schema.ResourceData, s3Config *firehose.S3Dest config.S3BackupMode = aws.String(s3BackupMode.(string)) } + if _, ok := es["vpc_config"]; ok { + config.VpcConfiguration = extractVpcConfiguration(es) + } + return config, nil } diff --git a/aws/resource_aws_kinesis_firehose_delivery_stream_test.go b/aws/resource_aws_kinesis_firehose_delivery_stream_test.go index 099f901f27be..33b98a7fc408 100644 --- a/aws/resource_aws_kinesis_firehose_delivery_stream_test.go +++ b/aws/resource_aws_kinesis_firehose_delivery_stream_test.go @@ -1054,6 +1054,72 @@ func TestAccAWSKinesisFirehoseDeliveryStream_ElasticsearchConfigUpdates(t *testi }) } +func TestAccAWSKinesisFirehoseDeliveryStream_ElasticsearchWithVpcConfigUpdates(t *testing.T) { + var stream firehose.DeliveryStreamDescription + + resourceName := "aws_kinesis_firehose_delivery_stream.test" + ri := acctest.RandInt() + rString := acctest.RandString(8) + funcName := fmt.Sprintf("aws_kinesis_firehose_delivery_stream_test_%s", rString) + policyName := fmt.Sprintf("tf_acc_policy_%s", rString) + roleName := fmt.Sprintf("tf_acc_role_%s", rString) + preConfigWithVpc := fmt.Sprintf(testAccKinesisFirehoseDeliveryStreamConfig_ElasticsearchVpcBasic, + ri, ri, ri, ri, ri) + + postConfigWithVpc := testAccFirehoseAWSLambdaConfigBasic(funcName, policyName, roleName) + + fmt.Sprintf(testAccKinesisFirehoseDeliveryStreamConfig_ElasticsearchVpcUpdate, + ri, ri, ri, ri, ri) + + updatedElasticSearchConfig := &firehose.ElasticsearchDestinationDescription{ + BufferingHints: &firehose.ElasticsearchBufferingHints{ + IntervalInSeconds: aws.Int64(500), + }, + ProcessingConfiguration: &firehose.ProcessingConfiguration{ + Enabled: aws.Bool(true), + Processors: []*firehose.Processor{ + { + Type: aws.String("Lambda"), + Parameters: []*firehose.ProcessorParameter{ + { + ParameterName: aws.String("LambdaArn"), + ParameterValue: aws.String("valueNotTested"), + }, + }, + }, + }, + }, + } + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckKinesisFirehoseDeliveryStreamDestroy, + Steps: []resource.TestStep{ + { + Config: preConfigWithVpc, + Check: resource.ComposeTestCheckFunc( + testAccCheckKinesisFirehoseDeliveryStreamExists("aws_kinesis_firehose_delivery_stream.test", &stream), + testAccCheckAWSKinesisFirehoseDeliveryStreamAttributes(&stream, nil, nil, nil, nil, nil), + resource.TestMatchResourceAttr(resourceName, "elasticsearch_configuration.0.vpc_config.0.vpc_id", regexp.MustCompile(`^vpc-.+$`)), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: postConfigWithVpc, + Check: resource.ComposeTestCheckFunc( + testAccCheckKinesisFirehoseDeliveryStreamExists("aws_kinesis_firehose_delivery_stream.test", &stream), + testAccCheckAWSKinesisFirehoseDeliveryStreamAttributes(&stream, nil, nil, nil, updatedElasticSearchConfig, nil), + resource.TestMatchResourceAttr(resourceName, "elasticsearch_configuration.0.vpc_config.0.vpc_id", regexp.MustCompile(`^vpc-.+$`)), + ), + }, + }, + }) +} + // Regression test for https://github.com/terraform-providers/terraform-provider-aws/issues/1657 func TestAccAWSKinesisFirehoseDeliveryStream_missingProcessingConfiguration(t *testing.T) { var stream firehose.DeliveryStreamDescription @@ -2282,6 +2348,113 @@ EOF } ` +// ElasticSearch associated with VPC +var testAccKinesisFirehoseDeliveryStreamBaseElasticsearchVpcConfig = testAccKinesisFirehoseDeliveryStreamBaseConfig + ` +data "aws_availability_zones" "available" { + state = "available" + + filter { + name = "opt-in-status" + values = ["opt-in-not-required"] + } +} + +resource "aws_vpc" "elasticsearch_in_vpc" { + cidr_block = "192.168.0.0/22" + + tags = { + Name = "terraform-testacc-elasticsearch-domain-in-vpc" + } +} + +resource "aws_subnet" "first" { + vpc_id = "${aws_vpc.elasticsearch_in_vpc.id}" + availability_zone = "${data.aws_availability_zones.available.names[0]}" + cidr_block = "192.168.0.0/24" + + tags = { + Name = "tf-acc-elasticsearch-domain-in-vpc-first" + } +} + +resource "aws_subnet" "second" { + vpc_id = "${aws_vpc.elasticsearch_in_vpc.id}" + availability_zone = "${data.aws_availability_zones.available.names[1]}" + cidr_block = "192.168.1.0/24" + + tags = { + Name = "tf-acc-elasticsearch-domain-in-vpc-second" + } +} + +resource "aws_security_group" "first" { + vpc_id = "${aws_vpc.elasticsearch_in_vpc.id}" +} + +resource "aws_security_group" "second" { + vpc_id = "${aws_vpc.elasticsearch_in_vpc.id}" +} + +resource "aws_elasticsearch_domain" "test_cluster" { + + domain_name = "es-test-%d" + + cluster_config { + instance_count = 2 + zone_awareness_enabled = true + instance_type = "t2.small.elasticsearch" + } + + ebs_options { + ebs_enabled = true + volume_size = 10 + } + + vpc_options { + security_group_ids = ["${aws_security_group.first.id}", "${aws_security_group.second.id}"] + subnet_ids = ["${aws_subnet.first.id}", "${aws_subnet.second.id}"] + } +} + +resource "aws_iam_role_policy" "firehose-elasticsearch" { + name = "elasticsearch" + role = "${aws_iam_role.firehose.id}" + policy = < **NOTE:** Once configured, the data format conversion configuration can only be disabled, in which the configuration values will remain, but will not be active. It is not currently possible to completely remove the configuration without recreating the resource. From cb40c4c36de418b780c5d3d492322cb51f711b8a Mon Sep 17 00:00:00 2001 From: Rajendra Raghavendra Date: Mon, 11 May 2020 19:56:17 -0500 Subject: [PATCH 22/36] address PR comments --- ...ce_aws_kinesis_firehose_delivery_stream.go | 21 ++--- ...s_kinesis_firehose_delivery_stream_test.go | 4 +- ...sis_firehose_delivery_stream.html.markdown | 86 ++++++++++++++++++- 3 files changed, 94 insertions(+), 17 deletions(-) diff --git a/aws/resource_aws_kinesis_firehose_delivery_stream.go b/aws/resource_aws_kinesis_firehose_delivery_stream.go index bbf22f93e33a..0fe2330c80f7 100644 --- a/aws/resource_aws_kinesis_firehose_delivery_stream.go +++ b/aws/resource_aws_kinesis_firehose_delivery_stream.go @@ -1315,8 +1315,9 @@ func resourceAwsKinesisFirehoseDeliveryStream() *schema.Resource { Set: schema.HashString, }, "role_arn": { - Type: schema.TypeString, - Required: true, + Type: schema.TypeString, + Required: true, + ValidateFunc: validateArn, }, }, }, @@ -1878,21 +1879,13 @@ func extractVpcConfiguration(es map[string]interface{}) *firehose.VpcConfigurati if len(config) == 0 { return nil } + vpcConfig := config[0].(map[string]interface{}) - s := vpcConfig["subnet_ids"].(*schema.Set).List() - subnets := make([]string, len(s)) - for i, v := range s { - subnets[i] = fmt.Sprint(v) - } - sg := vpcConfig["security_group_ids"].(*schema.Set).List() - securityGroups := make([]string, len(sg)) - for i, v := range sg { - securityGroups[i] = fmt.Sprint(v) - } + return &firehose.VpcConfiguration{ RoleARN: aws.String(vpcConfig["role_arn"].(string)), - SubnetIds: aws.StringSlice(subnets), - SecurityGroupIds: aws.StringSlice(securityGroups), + SubnetIds: expandStringSet(vpcConfig["subnet_ids"].(*schema.Set)), + SecurityGroupIds: expandStringSet(vpcConfig["security_group_ids"].(*schema.Set)), } } diff --git a/aws/resource_aws_kinesis_firehose_delivery_stream_test.go b/aws/resource_aws_kinesis_firehose_delivery_stream_test.go index 33b98a7fc408..b8b966dc8fb7 100644 --- a/aws/resource_aws_kinesis_firehose_delivery_stream_test.go +++ b/aws/resource_aws_kinesis_firehose_delivery_stream_test.go @@ -2493,7 +2493,7 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { subnet_ids = ["${aws_subnet.first.id}", "${aws_subnet.second.id}"] security_group_ids = ["${aws_security_group.first.id}", "${aws_security_group.second.id}"] role_arn = "${aws_iam_role.firehose.arn}" - } + } } } ` @@ -2546,7 +2546,7 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { subnet_ids = ["${aws_subnet.first.id}", "${aws_subnet.second.id}"] security_group_ids = ["${aws_security_group.first.id}", "${aws_security_group.second.id}"] role_arn = "${aws_iam_role.firehose.arn}" - } + } processing_configuration { enabled = false processors { diff --git a/website/docs/r/kinesis_firehose_delivery_stream.html.markdown b/website/docs/r/kinesis_firehose_delivery_stream.html.markdown index b57bfdab141d..c193b9a87227 100644 --- a/website/docs/r/kinesis_firehose_delivery_stream.html.markdown +++ b/website/docs/r/kinesis_firehose_delivery_stream.html.markdown @@ -137,7 +137,7 @@ resource "aws_kinesis_firehose_delivery_stream" "test_stream" { ```hcl resource "aws_redshift_cluster" "test_cluster" { - cluster_identifier = "tf-redshift-cluster-%d" + cluster_identifier = "tf-redshift-cluster" database_name = "test" master_username = "testuser" master_password = "T3stPass" @@ -219,6 +219,90 @@ resource "aws_kinesis_firehose_delivery_stream" "test_stream" { } ``` +### Elasticsearch Destination With VPC + +```hcl +resource "aws_elasticsearch_domain" "test_cluster" { + domain_name = "es-test" + + cluster_config { + instance_count = 2 + zone_awareness_enabled = true + instance_type = "t2.small.elasticsearch" + } + + ebs_options { + ebs_enabled = true + volume_size = 10 + } + + vpc_options { + security_group_ids = ["${aws_security_group.first.id}"] + subnet_ids = ["${aws_subnet.first.id}", "${aws_subnet.second.id}"] + } +} + +resource "aws_iam_role_policy" "firehose-elasticsearch" { + name = "elasticsearch" + role = "${aws_iam_role.firehose.id}" + policy = < Date: Wed, 15 Jul 2020 12:58:24 -0400 Subject: [PATCH 23/36] Add a readme file to explain our decision Also, disable the github actions since we do not use it and it makes our project failing the GitHub build part. The build is still done on Travis CI. --- .../changelog.yml | 0 .../dependencies.yml | 0 .../examples.yml | 0 .../issues.yml | 0 .../stale.yml | 0 .../team_slack_bot.yml | 0 .../terraform_provider.yml | 0 .../website.yml | 0 README-COVEO.md | 36 +++++++++++++++++++ 9 files changed, 36 insertions(+) rename .github/{workflows => workflows.disabled}/changelog.yml (100%) rename .github/{workflows => workflows.disabled}/dependencies.yml (100%) rename .github/{workflows => workflows.disabled}/examples.yml (100%) rename .github/{workflows => workflows.disabled}/issues.yml (100%) rename .github/{workflows => workflows.disabled}/stale.yml (100%) rename .github/{workflows => workflows.disabled}/team_slack_bot.yml (100%) rename .github/{workflows => workflows.disabled}/terraform_provider.yml (100%) rename .github/{workflows => workflows.disabled}/website.yml (100%) create mode 100644 README-COVEO.md diff --git a/.github/workflows/changelog.yml b/.github/workflows.disabled/changelog.yml similarity index 100% rename from .github/workflows/changelog.yml rename to .github/workflows.disabled/changelog.yml diff --git a/.github/workflows/dependencies.yml b/.github/workflows.disabled/dependencies.yml similarity index 100% rename from .github/workflows/dependencies.yml rename to .github/workflows.disabled/dependencies.yml diff --git a/.github/workflows/examples.yml b/.github/workflows.disabled/examples.yml similarity index 100% rename from .github/workflows/examples.yml rename to .github/workflows.disabled/examples.yml diff --git a/.github/workflows/issues.yml b/.github/workflows.disabled/issues.yml similarity index 100% rename from .github/workflows/issues.yml rename to .github/workflows.disabled/issues.yml diff --git a/.github/workflows/stale.yml b/.github/workflows.disabled/stale.yml similarity index 100% rename from .github/workflows/stale.yml rename to .github/workflows.disabled/stale.yml diff --git a/.github/workflows/team_slack_bot.yml b/.github/workflows.disabled/team_slack_bot.yml similarity index 100% rename from .github/workflows/team_slack_bot.yml rename to .github/workflows.disabled/team_slack_bot.yml diff --git a/.github/workflows/terraform_provider.yml b/.github/workflows.disabled/terraform_provider.yml similarity index 100% rename from .github/workflows/terraform_provider.yml rename to .github/workflows.disabled/terraform_provider.yml diff --git a/.github/workflows/website.yml b/.github/workflows.disabled/website.yml similarity index 100% rename from .github/workflows/website.yml rename to .github/workflows.disabled/website.yml diff --git a/README-COVEO.md b/README-COVEO.md new file mode 100644 index 000000000000..9a3c577a424a --- /dev/null +++ b/README-COVEO.md @@ -0,0 +1,36 @@ +# Naming a version + +Previously, we were using a tagging scheme where we added `-coveo.n` to official tagged version. + +However, this causes problems when a user is restricting the version of its provider. If a user add: + +```hcl +provider "aws" { + version = ">= 2.28.1" + region = var.region +} +``` + +or: + +```hcl +terraform { + required_version = ">= 0.12.9" + required_providers { + aws = ">= 2.52.0" + local = ">= 1.4" + null = ">= 2.1" + template = ">= 2.1" + random = ">= 2.1" + kubernetes = ">= 1.11.1" + } +}``` + +Then, our forked version will be ignored and the official one will be used. + +To avoid this, starting with version 2.70, we will now release our forked version by adding 10 to patch version. + +```text +terraform-provider-aws_v2.70.0 => terraform-provider-aws_v2.70.10 +terraform-provider-aws_v2.70.1 => terraform-provider-aws_v2.70.11 +``` From 33bcfe63e548c6e413cddc800552d568a3c581ca Mon Sep 17 00:00:00 2001 From: Julien Duchesne Date: Tue, 24 Nov 2020 14:15:31 -0500 Subject: [PATCH 24/36] Add release workflow --- .github/workflows/release.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000000..ccdbdc4abc50 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,28 @@ +name: Build Tags +on: + push: + tags: + - "*" +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - name: Setup Go + uses: actions/setup-go@v1 + with: + go-version: 1.14 + id: go + + - name: Checkout + uses: actions/checkout@v1 + - name: Download dependencies + run: go mod download + - name: Build tag + uses: goreleaser/goreleaser-action@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 6b9e6cd112b59f05e0de73ebe2bdff1f8ae160c1 Mon Sep 17 00:00:00 2001 From: Jo Giroux Date: Fri, 21 May 2021 14:36:33 -0400 Subject: [PATCH 25/36] No longer use travis --- .travis.yml | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 6c2e54864680..000000000000 --- a/.travis.yml +++ /dev/null @@ -1,33 +0,0 @@ -dist: xenial -sudo: required -services: - - docker -language: go -go_import_path: github.com/terraform-providers/terraform-provider-aws - -env: - global: GOFLAGS=-mod=vendor - -matrix: - fast_finish: true - allow_failures: - - go: tip - include: - - go: "1.14.x" - name: "Code Lint" - script: make lint - - go: "1.14.x" - name: "Code UnitTest" - script: make test - - go: "1.14.x" - name: "Dependencies" - script: make depscheck - -install: - - make tools - -after_success: - - if [ ${TRAVIS_TAG::1} = v ]; - then - curl -sL https://git.io/goreleaser | bash; - fi From d338acf4c154d2209c9a891d0248f767aac6fd9a Mon Sep 17 00:00:00 2001 From: Jo Giroux Date: Fri, 21 May 2021 14:38:20 -0400 Subject: [PATCH 26/36] Fix merge error on github action --- .github/workflows/release.yml | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5331a2a887bf..ccdbdc4abc50 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,19 +26,3 @@ jobs: args: release --rm-dist env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - NEW_RELEASE_LINE=$(echo $PREVIOUS_RELEASE_TAG | awk -F. '{ - $1 = substr($1,2) - $2 += 1 - printf("%s.%02d.%s\n\n", $1, $2, $3); - }') - - echo New minor version is: v$NEW_RELEASE_LINE - - echo -e "## $NEW_RELEASE_LINE (Unreleased)\n$(cat $CHANGELOG_FILE_NAME)" > $CHANGELOG_FILE_NAME - - run: | - git config --local user.email changelogbot@hashicorp.com - git config --local user.name changelogbot - git add CHANGELOG.md - git commit -m "Update CHANGELOG.md after ${{ github.event.release.tag_name }}" - git push From 303881f51d9908bb9c43aaf89cddb83be7f8d475 Mon Sep 17 00:00:00 2001 From: Jo Giroux Date: Fri, 21 May 2021 14:59:08 -0400 Subject: [PATCH 27/36] Fix merge difference on ssm_parameter --- aws/resource_aws_ssm_parameter.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aws/resource_aws_ssm_parameter.go b/aws/resource_aws_ssm_parameter.go index 552e88bdb074..dff1e0729fa2 100644 --- a/aws/resource_aws_ssm_parameter.go +++ b/aws/resource_aws_ssm_parameter.go @@ -126,7 +126,7 @@ func resourceAwsSsmParameterCreate(d *schema.ResourceData, meta interface{}) err Type: aws.String(d.Get("type").(string)), Tier: aws.String(d.Get("tier").(string)), Value: aws.String(d.Get("value").(string)), - Overwrite: aws.Bool(shouldUpdateSsmParameter(d)), + Overwrite: aws.Bool(!d.IsNewResource()), AllowedPattern: aws.String(d.Get("allowed_pattern").(string)), } @@ -284,7 +284,7 @@ func resourceAwsSsmParameterUpdate(d *schema.ResourceData, meta interface{}) err Type: aws.String(d.Get("type").(string)), Tier: aws.String(d.Get("tier").(string)), Value: aws.String(d.Get("value").(string)), - Overwrite: aws.Bool(shouldUpdateSsmParameter(d)), + Overwrite: aws.Bool(!d.IsNewResource()), AllowedPattern: aws.String(d.Get("allowed_pattern").(string)), } From 7bf2b75680ccd94041c82f0213cfc64a276e3282 Mon Sep 17 00:00:00 2001 From: Jo Giroux Date: Fri, 21 May 2021 15:16:53 -0400 Subject: [PATCH 28/36] Build must now be done with go 1.16 --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ccdbdc4abc50..a88b62b0b5f0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v1 with: - go-version: 1.14 + go-version: 1.16 id: go - name: Checkout From 2a6b8f4bea44758613473aa7791703282b88dfcd Mon Sep 17 00:00:00 2001 From: Jo Giroux Date: Tue, 25 May 2021 10:47:15 -0400 Subject: [PATCH 29/36] Disable unused action in this fork --- .../{workflows => workflows.disabled}/acctest-terraform-lint.yml | 0 .github/{workflows => workflows.disabled}/documentation.yml | 0 .github/{workflows => workflows.disabled}/firewatch.yml | 0 .github/{workflows => workflows.disabled}/generate_changelog.yml | 0 .github/{workflows => workflows.disabled}/milestone.yml | 0 .github/{workflows => workflows.disabled}/project.yml | 0 .github/{workflows => workflows.disabled}/pull_requests.yml | 0 .github/{workflows => workflows.disabled}/snapshot.yml | 0 8 files changed, 0 insertions(+), 0 deletions(-) rename .github/{workflows => workflows.disabled}/acctest-terraform-lint.yml (100%) rename .github/{workflows => workflows.disabled}/documentation.yml (100%) rename .github/{workflows => workflows.disabled}/firewatch.yml (100%) rename .github/{workflows => workflows.disabled}/generate_changelog.yml (100%) rename .github/{workflows => workflows.disabled}/milestone.yml (100%) rename .github/{workflows => workflows.disabled}/project.yml (100%) rename .github/{workflows => workflows.disabled}/pull_requests.yml (100%) rename .github/{workflows => workflows.disabled}/snapshot.yml (100%) diff --git a/.github/workflows/acctest-terraform-lint.yml b/.github/workflows.disabled/acctest-terraform-lint.yml similarity index 100% rename from .github/workflows/acctest-terraform-lint.yml rename to .github/workflows.disabled/acctest-terraform-lint.yml diff --git a/.github/workflows/documentation.yml b/.github/workflows.disabled/documentation.yml similarity index 100% rename from .github/workflows/documentation.yml rename to .github/workflows.disabled/documentation.yml diff --git a/.github/workflows/firewatch.yml b/.github/workflows.disabled/firewatch.yml similarity index 100% rename from .github/workflows/firewatch.yml rename to .github/workflows.disabled/firewatch.yml diff --git a/.github/workflows/generate_changelog.yml b/.github/workflows.disabled/generate_changelog.yml similarity index 100% rename from .github/workflows/generate_changelog.yml rename to .github/workflows.disabled/generate_changelog.yml diff --git a/.github/workflows/milestone.yml b/.github/workflows.disabled/milestone.yml similarity index 100% rename from .github/workflows/milestone.yml rename to .github/workflows.disabled/milestone.yml diff --git a/.github/workflows/project.yml b/.github/workflows.disabled/project.yml similarity index 100% rename from .github/workflows/project.yml rename to .github/workflows.disabled/project.yml diff --git a/.github/workflows/pull_requests.yml b/.github/workflows.disabled/pull_requests.yml similarity index 100% rename from .github/workflows/pull_requests.yml rename to .github/workflows.disabled/pull_requests.yml diff --git a/.github/workflows/snapshot.yml b/.github/workflows.disabled/snapshot.yml similarity index 100% rename from .github/workflows/snapshot.yml rename to .github/workflows.disabled/snapshot.yml From fbf17316a88e0fe601835965f000090e3bd3bf28 Mon Sep 17 00:00:00 2001 From: Jo Giroux Date: Tue, 25 May 2021 10:49:27 -0400 Subject: [PATCH 30/36] Fix go.sum --- go.sum | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/go.sum b/go.sum index 1116bb7e0f33..b43ef678a682 100644 --- a/go.sum +++ b/go.sum @@ -18,12 +18,15 @@ cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNF 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 h1:PQcPefKFdaIzjQFbiyOgAqyx8q5djaE7x9Sqe712DPA= 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 h1:/May9ojXjRkPBNVrq+oWLqmWCkr4OU5uRY29bu0mRyQ= 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 h1:ukjixP1wl0LpnZ6LWtZJ0mX5tBmjp1f8Sqer8Z2OMUU= 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= @@ -31,11 +34,17 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl 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 h1:VpgP7xuJadIUuKccphEpTJnWhS2jkQyMt6Y7pJCD7fY= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802 h1:1BDTz0u9nC3//pOCMdNH+CiXJVYJh5UQNCOBG7jbELc= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/Masterminds/goutils v1.1.0 h1:zukEsf/1JZwCMgHiK3GZftabmxiCw4apj3a28RPBiVg= github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= +github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= +github.com/Masterminds/sprig v2.22.0+incompatible h1:z4yfnGrZ7netVz+0EDJ0Wi+5VZCSYp4Z0m2dk6cEM60= 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= @@ -45,8 +54,11 @@ github.com/agext/levenshtein v1.2.2 h1:0S/Yg6LYmFJ5stwQeRp6EeOcCbj7xiqQSdNelsXva 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 h1:uSoVVbwJiQipAclBbw+8quDsfcvFjOpI5iCf4p/cqCs= github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs= +github.com/andybalholm/crlf v0.0.0-20171020200849-670099aa064f h1:NNJE6p4LchkmNfNskDUaSbrwxZzr7t2/lj2aS+q4oF0= 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 h1:kFOfPq6dUM1hTo4JG6LR5AXSUEsOjtdm0kw0FtQtMJA= 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= @@ -55,10 +67,13 @@ github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0 h1:MzVXffFU 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 h1:bNEQyAGak9tojivJNkoqWErVCQbjdL7GzRt3F8NvfJ0= 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 h1:BUAU3CGlLvorLI26FmByPp2eC2qla6E1Tw+scpcg/to= 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 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= 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= @@ -69,16 +84,25 @@ 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 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= 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 h1:glEXhBS5PSLLv4IXzLA5yPRVX4bilULVyxxbrfOtDAk= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cheggaaa/pb v1.0.27 h1:wIkZHkNfC7R6GI5w7l/PdAdzXzlrbcI3p8OAlnkTsnc= github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= +github.com/chzyer/logex v1.1.10 h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 h1:q763qf9huN11kDQavWsoZXJNW3xEE4JJyHa5Q25/sd8= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f h1:WBZRG4aNOuI15bLRrCgN8fCq8E5Xuty6jGbmSNEvSsU= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/creack/pty v1.1.9 h1:uDmaGzcdjhF4i/plgjmEsriH11Y0o7RKapEf/LDaM3w= 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= @@ -87,27 +111,36 @@ 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 h1:rEvIZUSZ3fx39WIi3JkQqQBitGwpELBIYWeBVh6wn+E= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/protoc-gen-validate v0.1.0 h1:EQciDnbrYxy13PgWoY8AqoxGiPrpgBZ1R8UNe3ddc+A= 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 h1:BHsljHzVlRcyQhjrss6TZTdY2VfCqZPbv5k3iBFa2ZQ= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= +github.com/gliderlabs/ssh v0.2.2 h1:6zsha5zo/TWhRhwqCD3+EarCAgZ2yN28ipRnGPnwkI0= 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/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= github.com/go-git/go-billy/v5 v5.1.0 h1:4pl5BV4o7ZG/lterP4S6WzJ6xr49Ba5ET9ygheTYahk= github.com/go-git/go-billy/v5 v5.1.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= +github.com/go-git/go-git-fixtures/v4 v4.0.2-0.20200613231340-f56387b50c12 h1:PbKy9zOy4aAKrJ5pibIRpVO2BXnK1Tlcg+caKI7Ox5M= github.com/go-git/go-git-fixtures/v4 v4.0.2-0.20200613231340-f56387b50c12/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw= github.com/go-git/go-git/v5 v5.3.0 h1:8WKMtJR2j8RntEXR/uvTKagfEt4GYlwQ7mntE4+0GWc= github.com/go-git/go-git/v5 v5.3.0/go.mod h1:xdX4bWJ48aOrdhnl2XqHYstHbbp6+LFS4r4X+lNVprw= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1 h1:QbL/5oDUmRBzO9/Z7Seo6zf912W/a6Sr4Eu0G/3Jho0= 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 h1:WtGNWLvXpe6ZudgnXrq0barxBImvnnJoMEhXAzcbM0I= 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 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs= 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 h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= 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= @@ -118,6 +151,7 @@ github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfb 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 h1:GV+pQPG/EUUbkh47niozDcADz6go/dUwhVzdUQHIVRw= 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= @@ -134,8 +168,10 @@ 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 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= 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 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= 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= @@ -156,8 +192,11 @@ github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hf 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 h1:Ak8CrdlwwXwAZxzS66vgPt4U8yUZX7JwLvVR58FN5jM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/renameio v0.1.0 h1:GOZbcHa3HfsPKPlmyPyN2KEohoMXOhdMbHrvbpl2QaA= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= 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= @@ -194,6 +233,7 @@ github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09 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 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU= 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= @@ -210,7 +250,9 @@ github.com/hashicorp/terraform-plugin-sdk/v2 v2.6.1/go.mod h1:72j8cKfs9IirGhPMXJ 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 h1:L18LIDzqlW6xN2rEkpdV8+oL/IXWJ1APd+vsdYy4Wdw= github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6 h1:UDMh68UUwekSh5iP2OMhRRZJiiBccgV7axzUG8vi56c= 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= @@ -219,6 +261,7 @@ github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOl 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 h1:1jKYvbxEjfUl0fmqTCOfonvskHHXMjBySTLW4y9LFvc= 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= @@ -236,13 +279,16 @@ github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 h1:DowS9hvgy 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 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg= 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 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= 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 h1:VkoXIwSboBpnk99O/KFauAEILuNHv5DVFKZMBN/gUgw= 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= @@ -261,7 +307,9 @@ github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcME 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 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mitchellh/cli v1.1.2 h1:PvH+lL2B7IQ101xQL63Of8yFS2y+aDlsFcsqNc+u/Kw= 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= @@ -284,28 +332,37 @@ github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx 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 h1:2xWsjqPFWcplujydGg4WmhC/6fZqK42wMM8aXeqhl0I= 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 h1:ccV59UEOTzVDnDUEFdT95ZzHVZ+5+158q8+SJb2QV5w= 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 h1:gQz4mCbXsO+nc9n1hCxHcGA3Zx3Eo+UHZoInFGUIXNM= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/rogpeppe/go-internal v1.3.0 h1:RR9dF3JtopPvtkroDZuVD7qquD0bnHlKSqaQhgwt8yk= 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/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/sirupsen/logrus v1.4.1 h1:GL2rEmy6nsikmW0r8opw9JIRScdMF5hA8cOYLH7In1k= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= +github.com/spf13/pflag v1.0.2 h1:Fy0orTDgHdbnzHcsOgfCN4LtHf0ec3wwtiwJqwvf3Gc= 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 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A= 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= @@ -319,17 +376,21 @@ github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oW 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 h1:07s4sz9IReOgdikxLTKNbBdqDMLsjPKXwvCazn8G65U= github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4= +github.com/vmihailenco/tagparser v0.1.1 h1:quXMXlA39OCbd2wAdTsGDlK9RkOk6Wuw+x37wVyIuWY= 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 h1:5tjfNdR2ki3yYQ842+eX2sQHeiwpKJ0RnHO4IYOc4V8= 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.2 h1:u+xZfBKgpycDnTNjPhGiTEYZS5qS/Sb5MqSfm7vzcjg= github.com/zclconf/go-cty v1.8.2/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= +github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b h1:FosyBZYxY34Wul7O/MSKey3txpPYyCqVO5ZyceuQJEI= 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= @@ -356,8 +417,10 @@ golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u0 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 h1:QE6XYQK6naiK1EPAe1g/ILLxN5RBoH5xkJk3CqlMI/Y= 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 h1:+qEpEAPhDZ1o0x3tHzZTQDArnOixOzGD9HUJfcg0mb4= 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= @@ -371,6 +434,7 @@ golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPI 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 h1:4+4C/Iv2U4fMZBiMCc98MG1In4gJY5YRhtpDNeDeHWs= 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= @@ -423,6 +487,7 @@ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJ 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 h1:qwRHBd0NqMbJxfbotnDhm2ByMI1Shq4Y6oRJo21SGJA= 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= @@ -471,6 +536,7 @@ golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= golang.org/x/text v0.3.5/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 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs= 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= @@ -598,7 +664,9 @@ gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8 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 h1:kJdccidYzt3CaHD1crCFTS1hxyhSi059NhOFUf03YFo= gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= +gopkg.in/errgo.v2 v2.1.0 h1:0vLT13EuvQ0hNvakwLuFZ/jYrLp5F3kcWHXdRggjCE8= 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= @@ -616,7 +684,11 @@ honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWh 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 h1:UoveltGrhghAA7ePc+e+QYDHXrBps2PqFZiHkGR/xK8= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +rsc.io/binaryregexp v0.2.0 h1:HfqmD5MEmC0zvwBuF187nq9mdnXjXsSivRiXN7SmRkE= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0 h1:9JKUTTIUgS6kzR9mK1YuGKv6Nl+DijDNIc0ghT58FaY= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0 h1:7uVkIFmeBqHfdjD+gZwtXXI+RODJ2Wc4O7MPEh/QiW4= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= From e6c20cf772ac772583e904a2c170d130e44da474 Mon Sep 17 00:00:00 2001 From: Jo Giroux Date: Tue, 25 May 2021 11:52:25 -0400 Subject: [PATCH 31/36] Disable dependabot on our fork --- .github/{dependabot.yml => dependabot.yml.disable} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{dependabot.yml => dependabot.yml.disable} (100%) diff --git a/.github/dependabot.yml b/.github/dependabot.yml.disable similarity index 100% rename from .github/dependabot.yml rename to .github/dependabot.yml.disable From c6ae1df1772366a551f5753769f3b6aa6bc6ea13 Mon Sep 17 00:00:00 2001 From: Philippe Ballandras Date: Mon, 16 Aug 2021 11:56:01 -0400 Subject: [PATCH 32/36] remove tags schema on resource that doesn't support it --- aws/resource_aws_secretsmanager_secret_rotation.go | 1 - 1 file changed, 1 deletion(-) diff --git a/aws/resource_aws_secretsmanager_secret_rotation.go b/aws/resource_aws_secretsmanager_secret_rotation.go index d5ad3079dc33..f31cf4a58de5 100644 --- a/aws/resource_aws_secretsmanager_secret_rotation.go +++ b/aws/resource_aws_secretsmanager_secret_rotation.go @@ -51,7 +51,6 @@ func resourceAwsSecretsManagerSecretRotation() *schema.Resource { }, }, }, - "tags": tagsSchema(), }, } } From 7796c0d820efdd1546538cea259419cb75f849b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20B=C3=A9gin?= Date: Tue, 21 Sep 2021 08:50:31 -0400 Subject: [PATCH 33/36] added some tabs for easy merging --- aws/provider.go | 1064 +++++++++++++++++++++++------------------------ 1 file changed, 532 insertions(+), 532 deletions(-) diff --git a/aws/provider.go b/aws/provider.go index 6750df621a22..bf730edaaf16 100644 --- a/aws/provider.go +++ b/aws/provider.go @@ -452,538 +452,538 @@ func Provider() *schema.Provider { }, ResourcesMap: map[string]*schema.Resource{ - "aws_accessanalyzer_analyzer": resourceAwsAccessAnalyzerAnalyzer(), - "aws_acm_certificate": resourceAwsAcmCertificate(), - "aws_acm_certificate_validation": resourceAwsAcmCertificateValidation(), - "aws_acmpca_certificate_authority": resourceAwsAcmpcaCertificateAuthority(), - "aws_acmpca_certificate_authority_certificate": resourceAwsAcmpcaCertificateAuthorityCertificate(), - "aws_acmpca_certificate": resourceAwsAcmpcaCertificate(), - "aws_ami": resourceAwsAmi(), - "aws_ami_copy": resourceAwsAmiCopy(), - "aws_ami_from_instance": resourceAwsAmiFromInstance(), - "aws_ami_launch_permission": resourceAwsAmiLaunchPermission(), - "aws_amplify_app": resourceAwsAmplifyApp(), - "aws_amplify_backend_environment": resourceAwsAmplifyBackendEnvironment(), - "aws_amplify_branch": resourceAwsAmplifyBranch(), - "aws_amplify_domain_association": resourceAwsAmplifyDomainAssociation(), - "aws_amplify_webhook": resourceAwsAmplifyWebhook(), - "aws_api_gateway_account": resourceAwsApiGatewayAccount(), - "aws_api_gateway_api_key": resourceAwsApiGatewayApiKey(), - "aws_api_gateway_authorizer": resourceAwsApiGatewayAuthorizer(), - "aws_api_gateway_base_path_mapping": resourceAwsApiGatewayBasePathMapping(), - "aws_api_gateway_client_certificate": resourceAwsApiGatewayClientCertificate(), - "aws_api_gateway_deployment": resourceAwsApiGatewayDeployment(), - "aws_api_gateway_documentation_part": resourceAwsApiGatewayDocumentationPart(), - "aws_api_gateway_documentation_version": resourceAwsApiGatewayDocumentationVersion(), - "aws_api_gateway_domain_name": resourceAwsApiGatewayDomainName(), - "aws_api_gateway_gateway_response": resourceAwsApiGatewayGatewayResponse(), - "aws_api_gateway_integration": resourceAwsApiGatewayIntegration(), - "aws_api_gateway_integration_response": resourceAwsApiGatewayIntegrationResponse(), - "aws_api_gateway_method": resourceAwsApiGatewayMethod(), - "aws_api_gateway_method_response": resourceAwsApiGatewayMethodResponse(), - "aws_api_gateway_method_settings": resourceAwsApiGatewayMethodSettings(), - "aws_api_gateway_model": resourceAwsApiGatewayModel(), - "aws_api_gateway_request_validator": resourceAwsApiGatewayRequestValidator(), - "aws_api_gateway_resource": resourceAwsApiGatewayResource(), - "aws_api_gateway_rest_api": resourceAwsApiGatewayRestApi(), - "aws_api_gateway_rest_api_policy": resourceAwsApiGatewayRestApiPolicy(), - "aws_api_gateway_stage": resourceAwsApiGatewayStage(), - "aws_api_gateway_usage_plan": resourceAwsApiGatewayUsagePlan(), - "aws_api_gateway_usage_plan_key": resourceAwsApiGatewayUsagePlanKey(), - "aws_api_gateway_vpc_link": resourceAwsApiGatewayVpcLink(), - "aws_apigatewayv2_api": resourceAwsApiGatewayV2Api(), - "aws_apigatewayv2_api_mapping": resourceAwsApiGatewayV2ApiMapping(), - "aws_apigatewayv2_authorizer": resourceAwsApiGatewayV2Authorizer(), - "aws_apigatewayv2_deployment": resourceAwsApiGatewayV2Deployment(), - "aws_apigatewayv2_domain_name": resourceAwsApiGatewayV2DomainName(), - "aws_apigatewayv2_integration": resourceAwsApiGatewayV2Integration(), - "aws_apigatewayv2_integration_response": resourceAwsApiGatewayV2IntegrationResponse(), - "aws_apigatewayv2_model": resourceAwsApiGatewayV2Model(), - "aws_apigatewayv2_route": resourceAwsApiGatewayV2Route(), - "aws_apigatewayv2_route_response": resourceAwsApiGatewayV2RouteResponse(), - "aws_apigatewayv2_stage": resourceAwsApiGatewayV2Stage(), - "aws_apigatewayv2_vpc_link": resourceAwsApiGatewayV2VpcLink(), - "aws_app_cookie_stickiness_policy": resourceAwsAppCookieStickinessPolicy(), - "aws_appautoscaling_target": resourceAwsAppautoscalingTarget(), - "aws_appautoscaling_policy": resourceAwsAppautoscalingPolicy(), - "aws_appautoscaling_scheduled_action": resourceAwsAppautoscalingScheduledAction(), - "aws_appmesh_gateway_route": resourceAwsAppmeshGatewayRoute(), - "aws_appmesh_mesh": resourceAwsAppmeshMesh(), - "aws_appmesh_route": resourceAwsAppmeshRoute(), - "aws_appmesh_virtual_gateway": resourceAwsAppmeshVirtualGateway(), - "aws_appmesh_virtual_node": resourceAwsAppmeshVirtualNode(), - "aws_appmesh_virtual_router": resourceAwsAppmeshVirtualRouter(), - "aws_appmesh_virtual_service": resourceAwsAppmeshVirtualService(), - "aws_apprunner_auto_scaling_configuration_version": resourceAwsAppRunnerAutoScalingConfigurationVersion(), - "aws_apprunner_connection": resourceAwsAppRunnerConnection(), - "aws_apprunner_custom_domain_association": resourceAwsAppRunnerCustomDomainAssociation(), - "aws_apprunner_service": resourceAwsAppRunnerService(), - "aws_appsync_api_key": resourceAwsAppsyncApiKey(), - "aws_appsync_datasource": resourceAwsAppsyncDatasource(), - "aws_appsync_function": resourceAwsAppsyncFunction(), - "aws_appsync_graphql_api": resourceAwsAppsyncGraphqlApi(), - "aws_appsync_resolver": resourceAwsAppsyncResolver(), - "aws_athena_database": resourceAwsAthenaDatabase(), - "aws_athena_named_query": resourceAwsAthenaNamedQuery(), - "aws_athena_workgroup": resourceAwsAthenaWorkgroup(), - "aws_autoscaling_attachment": resourceAwsAutoscalingAttachment(), - "aws_autoscaling_group": resourceAwsAutoscalingGroup(), - "aws_autoscaling_lifecycle_hook": resourceAwsAutoscalingLifecycleHook(), - "aws_autoscaling_notification": resourceAwsAutoscalingNotification(), - "aws_autoscaling_policy": resourceAwsAutoscalingPolicy(), - "aws_autoscaling_schedule": resourceAwsAutoscalingSchedule(), - "aws_autoscalingplans_scaling_plan": resourceAwsAutoScalingPlansScalingPlan(), - "aws_backup_global_settings": resourceAwsBackupGlobalSettings(), - "aws_backup_plan": resourceAwsBackupPlan(), - "aws_backup_region_settings": resourceAwsBackupRegionSettings(), - "aws_backup_selection": resourceAwsBackupSelection(), - "aws_backup_vault": resourceAwsBackupVault(), - "aws_backup_vault_notifications": resourceAwsBackupVaultNotifications(), - "aws_backup_vault_policy": resourceAwsBackupVaultPolicy(), - "aws_budgets_budget": resourceAwsBudgetsBudget(), - "aws_budgets_budget_action": resourceAwsBudgetsBudgetAction(), - "aws_cloud9_environment_ec2": resourceAwsCloud9EnvironmentEc2(), - "aws_cloudformation_stack": resourceAwsCloudFormationStack(), - "aws_cloudformation_stack_set": resourceAwsCloudFormationStackSet(), - "aws_cloudformation_stack_set_instance": resourceAwsCloudFormationStackSetInstance(), - "aws_cloudformation_type": resourceAwsCloudFormationType(), - "aws_cloudfront_cache_policy": resourceAwsCloudFrontCachePolicy(), - "aws_cloudfront_distribution": resourceAwsCloudFrontDistribution(), - "aws_cloudfront_function": resourceAwsCloudFrontFunction(), - "aws_cloudfront_key_group": resourceAwsCloudFrontKeyGroup(), - "aws_cloudfront_monitoring_subscription": resourceAwsCloudFrontMonitoringSubscription(), - "aws_cloudfront_origin_access_identity": resourceAwsCloudFrontOriginAccessIdentity(), - "aws_cloudfront_origin_request_policy": resourceAwsCloudFrontOriginRequestPolicy(), - "aws_cloudfront_public_key": resourceAwsCloudFrontPublicKey(), - "aws_cloudfront_realtime_log_config": resourceAwsCloudFrontRealtimeLogConfig(), - "aws_cloudtrail": resourceAwsCloudTrail(), - "aws_cloudwatch_event_bus": resourceAwsCloudWatchEventBus(), - "aws_cloudwatch_event_bus_policy": resourceAwsCloudWatchEventBusPolicy(), - "aws_cloudwatch_event_permission": resourceAwsCloudWatchEventPermission(), - "aws_cloudwatch_event_rule": resourceAwsCloudWatchEventRule(), - "aws_cloudwatch_event_target": resourceAwsCloudWatchEventTarget(), - "aws_cloudwatch_event_archive": resourceAwsCloudWatchEventArchive(), - "aws_cloudwatch_event_connection": resourceAwsCloudWatchEventConnection(), - "aws_cloudwatch_event_api_destination": resourceAwsCloudWatchEventApiDestination(), - "aws_cloudwatch_log_destination": resourceAwsCloudWatchLogDestination(), - "aws_cloudwatch_log_destination_policy": resourceAwsCloudWatchLogDestinationPolicy(), - "aws_cloudwatch_log_group": resourceAwsCloudWatchLogGroup(), - "aws_cloudwatch_log_metric_filter": resourceAwsCloudWatchLogMetricFilter(), - "aws_cloudwatch_log_resource_policy": resourceAwsCloudWatchLogResourcePolicy(), - "aws_cloudwatch_log_stream": resourceAwsCloudWatchLogStream(), - "aws_cloudwatch_log_subscription_filter": resourceAwsCloudwatchLogSubscriptionFilter(), - "aws_config_aggregate_authorization": resourceAwsConfigAggregateAuthorization(), - "aws_config_config_rule": resourceAwsConfigConfigRule(), - "aws_config_configuration_aggregator": resourceAwsConfigConfigurationAggregator(), - "aws_config_configuration_recorder": resourceAwsConfigConfigurationRecorder(), - "aws_config_configuration_recorder_status": resourceAwsConfigConfigurationRecorderStatus(), - "aws_config_conformance_pack": resourceAwsConfigConformancePack(), - "aws_config_delivery_channel": resourceAwsConfigDeliveryChannel(), - "aws_config_organization_custom_rule": resourceAwsConfigOrganizationCustomRule(), - "aws_config_organization_managed_rule": resourceAwsConfigOrganizationManagedRule(), - "aws_config_remediation_configuration": resourceAwsConfigRemediationConfiguration(), - "aws_cognito_identity_pool": resourceAwsCognitoIdentityPool(), - "aws_cognito_identity_pool_roles_attachment": resourceAwsCognitoIdentityPoolRolesAttachment(), - "aws_cognito_identity_provider": resourceAwsCognitoIdentityProvider(), - "aws_cognito_resource_server": resourceAwsCognitoResourceServer(), - "aws_cognito_user_group": resourceAwsCognitoUserGroup(), - "aws_cognito_user_pool": resourceAwsCognitoUserPool(), - "aws_cognito_user_pool_client": resourceAwsCognitoUserPoolClient(), - "aws_cognito_user_pool_domain": resourceAwsCognitoUserPoolDomain(), - "aws_cognito_user_pool_ui_customization": resourceAwsCognitoUserPoolUICustomization(), - "aws_cloudhsm_v2_cluster": resourceAwsCloudHsmV2Cluster(), - "aws_cloudhsm_v2_hsm": resourceAwsCloudHsmV2Hsm(), - "aws_cloudwatch_composite_alarm": resourceAwsCloudWatchCompositeAlarm(), - "aws_cloudwatch_metric_alarm": resourceAwsCloudWatchMetricAlarm(), - "aws_cloudwatch_dashboard": resourceAwsCloudWatchDashboard(), - "aws_cloudwatch_metric_stream": resourceAwsCloudWatchMetricStream(), - "aws_cloudwatch_query_definition": resourceAwsCloudWatchQueryDefinition(), - "aws_codedeploy_app": resourceAwsCodeDeployApp(), - "aws_codedeploy_deployment_config": resourceAwsCodeDeployDeploymentConfig(), - "aws_codedeploy_deployment_group": resourceAwsCodeDeployDeploymentGroup(), - "aws_codecommit_repository": resourceAwsCodeCommitRepository(), - "aws_codecommit_trigger": resourceAwsCodeCommitTrigger(), - "aws_codeartifact_domain": resourceAwsCodeArtifactDomain(), - "aws_codeartifact_domain_permissions_policy": resourceAwsCodeArtifactDomainPermissionsPolicy(), - "aws_codeartifact_repository": resourceAwsCodeArtifactRepository(), - "aws_codeartifact_repository_permissions_policy": resourceAwsCodeArtifactRepositoryPermissionsPolicy(), - "aws_codebuild_project": resourceAwsCodeBuildProject(), - "aws_codebuild_report_group": resourceAwsCodeBuildReportGroup(), - "aws_codebuild_source_credential": resourceAwsCodeBuildSourceCredential(), - "aws_codebuild_webhook": resourceAwsCodeBuildWebhook(), - "aws_codepipeline": resourceAwsCodePipeline(), - "aws_codepipeline_webhook": resourceAwsCodePipelineWebhook(), - "aws_codestarconnections_connection": resourceAwsCodeStarConnectionsConnection(), - "aws_codestarconnections_host": resourceAwsCodeStarConnectionsHost(), - "aws_codestarnotifications_notification_rule": resourceAwsCodeStarNotificationsNotificationRule(), - "aws_cur_report_definition": resourceAwsCurReportDefinition(), - "aws_customer_gateway": resourceAwsCustomerGateway(), - "aws_datapipeline_pipeline": resourceAwsDataPipelinePipeline(), - "aws_datasync_agent": resourceAwsDataSyncAgent(), - "aws_datasync_location_efs": resourceAwsDataSyncLocationEfs(), - "aws_datasync_location_fsx_windows_file_system": resourceAwsDataSyncLocationFsxWindowsFileSystem(), - "aws_datasync_location_nfs": resourceAwsDataSyncLocationNfs(), - "aws_datasync_location_s3": resourceAwsDataSyncLocationS3(), - "aws_datasync_location_smb": resourceAwsDataSyncLocationSmb(), - "aws_datasync_task": resourceAwsDataSyncTask(), - "aws_dax_cluster": resourceAwsDaxCluster(), - "aws_dax_parameter_group": resourceAwsDaxParameterGroup(), - "aws_dax_subnet_group": resourceAwsDaxSubnetGroup(), - "aws_db_cluster_snapshot": resourceAwsDbClusterSnapshot(), - "aws_db_event_subscription": resourceAwsDbEventSubscription(), - "aws_db_instance": resourceAwsDbInstance(), - "aws_db_instance_role_association": resourceAwsDbInstanceRoleAssociation(), - "aws_db_option_group": resourceAwsDbOptionGroup(), - "aws_db_parameter_group": resourceAwsDbParameterGroup(), - "aws_db_proxy": resourceAwsDbProxy(), - "aws_db_proxy_default_target_group": resourceAwsDbProxyDefaultTargetGroup(), - "aws_db_proxy_endpoint": resourceAwsDbProxyEndpoint(), - "aws_db_proxy_target": resourceAwsDbProxyTarget(), - "aws_db_security_group": resourceAwsDbSecurityGroup(), - "aws_db_snapshot": resourceAwsDbSnapshot(), - "aws_db_subnet_group": resourceAwsDbSubnetGroup(), - "aws_devicefarm_project": resourceAwsDevicefarmProject(), - "aws_directory_service_directory": resourceAwsDirectoryServiceDirectory(), - "aws_directory_service_conditional_forwarder": resourceAwsDirectoryServiceConditionalForwarder(), - "aws_directory_service_log_subscription": resourceAwsDirectoryServiceLogSubscription(), - "aws_dlm_lifecycle_policy": resourceAwsDlmLifecyclePolicy(), - "aws_dms_certificate": resourceAwsDmsCertificate(), - "aws_dms_endpoint": resourceAwsDmsEndpoint(), - "aws_dms_event_subscription": resourceAwsDmsEventSubscription(), - "aws_dms_replication_instance": resourceAwsDmsReplicationInstance(), - "aws_dms_replication_subnet_group": resourceAwsDmsReplicationSubnetGroup(), - "aws_dms_replication_task": resourceAwsDmsReplicationTask(), - "aws_docdb_cluster": resourceAwsDocDBCluster(), - "aws_docdb_cluster_instance": resourceAwsDocDBClusterInstance(), - "aws_docdb_cluster_parameter_group": resourceAwsDocDBClusterParameterGroup(), - "aws_docdb_cluster_snapshot": resourceAwsDocDBClusterSnapshot(), - "aws_docdb_subnet_group": resourceAwsDocDBSubnetGroup(), - "aws_dx_bgp_peer": resourceAwsDxBgpPeer(), - "aws_dx_connection": resourceAwsDxConnection(), - "aws_dx_connection_association": resourceAwsDxConnectionAssociation(), - "aws_dx_gateway": resourceAwsDxGateway(), - "aws_dx_gateway_association": resourceAwsDxGatewayAssociation(), - "aws_dx_gateway_association_proposal": resourceAwsDxGatewayAssociationProposal(), - "aws_dx_hosted_private_virtual_interface": resourceAwsDxHostedPrivateVirtualInterface(), - "aws_dx_hosted_private_virtual_interface_accepter": resourceAwsDxHostedPrivateVirtualInterfaceAccepter(), - "aws_dx_hosted_public_virtual_interface": resourceAwsDxHostedPublicVirtualInterface(), - "aws_dx_hosted_public_virtual_interface_accepter": resourceAwsDxHostedPublicVirtualInterfaceAccepter(), - "aws_dx_hosted_transit_virtual_interface": resourceAwsDxHostedTransitVirtualInterface(), - "aws_dx_hosted_transit_virtual_interface_accepter": resourceAwsDxHostedTransitVirtualInterfaceAccepter(), - "aws_dx_lag": resourceAwsDxLag(), - "aws_dx_private_virtual_interface": resourceAwsDxPrivateVirtualInterface(), - "aws_dx_public_virtual_interface": resourceAwsDxPublicVirtualInterface(), - "aws_dx_transit_virtual_interface": resourceAwsDxTransitVirtualInterface(), - "aws_dynamodb_table": resourceAwsDynamoDbTable(), - "aws_dynamodb_table_item": resourceAwsDynamoDbTableItem(), - "aws_dynamodb_table_item_attribute": resourceAwsDynamoDbTableItemAttribute(), - "aws_dynamodb_global_table": resourceAwsDynamoDbGlobalTable(), - "aws_dynamodb_kinesis_streaming_destination": resourceAwsDynamoDbKinesisStreamingDestination(), - "aws_ebs_default_kms_key": resourceAwsEbsDefaultKmsKey(), - "aws_ebs_encryption_by_default": resourceAwsEbsEncryptionByDefault(), - "aws_ebs_snapshot": resourceAwsEbsSnapshot(), - "aws_ebs_snapshot_copy": resourceAwsEbsSnapshotCopy(), - "aws_ebs_volume": resourceAwsEbsVolume(), - "aws_ec2_availability_zone_group": resourceAwsEc2AvailabilityZoneGroup(), - "aws_ec2_capacity_reservation": resourceAwsEc2CapacityReservation(), - "aws_ec2_carrier_gateway": resourceAwsEc2CarrierGateway(), - "aws_ec2_client_vpn_authorization_rule": resourceAwsEc2ClientVpnAuthorizationRule(), - "aws_ec2_client_vpn_endpoint": resourceAwsEc2ClientVpnEndpoint(), - "aws_ec2_client_vpn_network_association": resourceAwsEc2ClientVpnNetworkAssociation(), - "aws_ec2_client_vpn_route": resourceAwsEc2ClientVpnRoute(), - "aws_ec2_fleet": resourceAwsEc2Fleet(), - "aws_ec2_local_gateway_route": resourceAwsEc2LocalGatewayRoute(), - "aws_ec2_local_gateway_route_table_vpc_association": resourceAwsEc2LocalGatewayRouteTableVpcAssociation(), - "aws_ec2_managed_prefix_list": resourceAwsEc2ManagedPrefixList(), - "aws_ec2_tag": resourceAwsEc2Tag(), - "aws_ec2_traffic_mirror_filter": resourceAwsEc2TrafficMirrorFilter(), - "aws_ec2_traffic_mirror_filter_rule": resourceAwsEc2TrafficMirrorFilterRule(), - "aws_ec2_traffic_mirror_target": resourceAwsEc2TrafficMirrorTarget(), - "aws_ec2_traffic_mirror_session": resourceAwsEc2TrafficMirrorSession(), - "aws_ec2_transit_gateway": resourceAwsEc2TransitGateway(), - "aws_ec2_transit_gateway_peering_attachment": resourceAwsEc2TransitGatewayPeeringAttachment(), - "aws_ec2_transit_gateway_peering_attachment_accepter": resourceAwsEc2TransitGatewayPeeringAttachmentAccepter(), - "aws_ec2_transit_gateway_prefix_list_reference": resourceAwsEc2TransitGatewayPrefixListReference(), - "aws_ec2_transit_gateway_route": resourceAwsEc2TransitGatewayRoute(), - "aws_ec2_transit_gateway_route_table": resourceAwsEc2TransitGatewayRouteTable(), - "aws_ec2_transit_gateway_route_table_association": resourceAwsEc2TransitGatewayRouteTableAssociation(), - "aws_ec2_transit_gateway_route_table_propagation": resourceAwsEc2TransitGatewayRouteTablePropagation(), - "aws_ec2_transit_gateway_vpc_attachment": resourceAwsEc2TransitGatewayVpcAttachment(), - "aws_ec2_transit_gateway_vpc_attachment_accepter": resourceAwsEc2TransitGatewayVpcAttachmentAccepter(), - "aws_ecr_lifecycle_policy": resourceAwsEcrLifecyclePolicy(), - "aws_ecrpublic_repository": resourceAwsEcrPublicRepository(), - "aws_ecr_registry_policy": resourceAwsEcrRegistryPolicy(), - "aws_ecr_replication_configuration": resourceAwsEcrReplicationConfiguration(), - "aws_ecr_repository": resourceAwsEcrRepository(), - "aws_ecr_repository_policy": resourceAwsEcrRepositoryPolicy(), - "aws_ecs_capacity_provider": resourceAwsEcsCapacityProvider(), - "aws_ecs_cluster": resourceAwsEcsCluster(), - "aws_ecs_service": resourceAwsEcsService(), - "aws_ecs_task_definition": resourceAwsEcsTaskDefinition(), - "aws_efs_access_point": resourceAwsEfsAccessPoint(), - "aws_efs_backup_policy": resourceAwsEfsBackupPolicy(), - "aws_efs_file_system": resourceAwsEfsFileSystem(), - "aws_efs_file_system_policy": resourceAwsEfsFileSystemPolicy(), - "aws_efs_mount_target": resourceAwsEfsMountTarget(), - "aws_egress_only_internet_gateway": resourceAwsEgressOnlyInternetGateway(), - "aws_eip": resourceAwsEip(), - "aws_eip_association": resourceAwsEipAssociation(), - "aws_eks_cluster": resourceAwsEksCluster(), - "aws_eks_addon": resourceAwsEksAddon(), - "aws_eks_fargate_profile": resourceAwsEksFargateProfile(), - "aws_eks_node_group": resourceAwsEksNodeGroup(), - "aws_elasticache_cluster": resourceAwsElasticacheCluster(), - "aws_elasticache_global_replication_group": resourceAwsElasticacheGlobalReplicationGroup(), - "aws_elasticache_parameter_group": resourceAwsElasticacheParameterGroup(), - "aws_elasticache_replication_group": resourceAwsElasticacheReplicationGroup(), - "aws_elasticache_security_group": resourceAwsElasticacheSecurityGroup(), - "aws_elasticache_subnet_group": resourceAwsElasticacheSubnetGroup(), - "aws_elastic_beanstalk_application": resourceAwsElasticBeanstalkApplication(), - "aws_elastic_beanstalk_application_version": resourceAwsElasticBeanstalkApplicationVersion(), - "aws_elastic_beanstalk_configuration_template": resourceAwsElasticBeanstalkConfigurationTemplate(), - "aws_elastic_beanstalk_environment": resourceAwsElasticBeanstalkEnvironment(), - "aws_elasticsearch_domain": resourceAwsElasticSearchDomain(), - "aws_elasticsearch_domain_policy": resourceAwsElasticSearchDomainPolicy(), - "aws_elasticsearch_domain_saml_options": resourceAwsElasticSearchDomainSAMLOptions(), - "aws_elastictranscoder_pipeline": resourceAwsElasticTranscoderPipeline(), - "aws_elastictranscoder_preset": resourceAwsElasticTranscoderPreset(), - "aws_elb": resourceAwsElb(), - "aws_elb_attachment": resourceAwsElbAttachment(), - "aws_emr_cluster": resourceAwsEMRCluster(), - "aws_emr_instance_group": resourceAwsEMRInstanceGroup(), - "aws_emr_instance_fleet": resourceAwsEMRInstanceFleet(), - "aws_emr_managed_scaling_policy": resourceAwsEMRManagedScalingPolicy(), - "aws_emr_security_configuration": resourceAwsEMRSecurityConfiguration(), - "aws_flow_log": resourceAwsFlowLog(), - "aws_fsx_lustre_file_system": resourceAwsFsxLustreFileSystem(), - "aws_fsx_windows_file_system": resourceAwsFsxWindowsFileSystem(), - "aws_fms_admin_account": resourceAwsFmsAdminAccount(), - "aws_fms_policy": resourceAwsFmsPolicy(), - "aws_gamelift_alias": resourceAwsGameliftAlias(), - "aws_gamelift_build": resourceAwsGameliftBuild(), - "aws_gamelift_fleet": resourceAwsGameliftFleet(), - "aws_gamelift_game_session_queue": resourceAwsGameliftGameSessionQueue(), - "aws_glacier_vault": resourceAwsGlacierVault(), - "aws_glacier_vault_lock": resourceAwsGlacierVaultLock(), - "aws_globalaccelerator_accelerator": resourceAwsGlobalAcceleratorAccelerator(), - "aws_globalaccelerator_endpoint_group": resourceAwsGlobalAcceleratorEndpointGroup(), - "aws_globalaccelerator_listener": resourceAwsGlobalAcceleratorListener(), - "aws_glue_catalog_database": resourceAwsGlueCatalogDatabase(), - "aws_glue_catalog_table": resourceAwsGlueCatalogTable(), - "aws_glue_classifier": resourceAwsGlueClassifier(), - "aws_glue_connection": resourceAwsGlueConnection(), - "aws_glue_dev_endpoint": resourceAwsGlueDevEndpoint(), - "aws_glue_crawler": resourceAwsGlueCrawler(), - "aws_glue_data_catalog_encryption_settings": resourceAwsGlueDataCatalogEncryptionSettings(), - "aws_glue_job": resourceAwsGlueJob(), - "aws_glue_ml_transform": resourceAwsGlueMLTransform(), - "aws_glue_partition": resourceAwsGluePartition(), - "aws_glue_registry": resourceAwsGlueRegistry(), - "aws_glue_resource_policy": resourceAwsGlueResourcePolicy(), - "aws_glue_schema": resourceAwsGlueSchema(), - "aws_glue_security_configuration": resourceAwsGlueSecurityConfiguration(), - "aws_glue_trigger": resourceAwsGlueTrigger(), - "aws_glue_user_defined_function": resourceAwsGlueUserDefinedFunction(), - "aws_glue_workflow": resourceAwsGlueWorkflow(), - "aws_guardduty_detector": resourceAwsGuardDutyDetector(), - "aws_guardduty_filter": resourceAwsGuardDutyFilter(), - "aws_guardduty_invite_accepter": resourceAwsGuardDutyInviteAccepter(), - "aws_guardduty_ipset": resourceAwsGuardDutyIpset(), - "aws_guardduty_member": resourceAwsGuardDutyMember(), - "aws_guardduty_organization_admin_account": resourceAwsGuardDutyOrganizationAdminAccount(), - "aws_guardduty_organization_configuration": resourceAwsGuardDutyOrganizationConfiguration(), - "aws_guardduty_publishing_destination": resourceAwsGuardDutyPublishingDestination(), - "aws_guardduty_threatintelset": resourceAwsGuardDutyThreatintelset(), - "aws_iam_access_key": resourceAwsIamAccessKey(), - "aws_iam_account_alias": resourceAwsIamAccountAlias(), - "aws_iam_account_password_policy": resourceAwsIamAccountPasswordPolicy(), - "aws_iam_group_policy": resourceAwsIamGroupPolicy(), - "aws_iam_group": resourceAwsIamGroup(), - "aws_iam_group_membership": resourceAwsIamGroupMembership(), - "aws_iam_group_policy_attachment": resourceAwsIamGroupPolicyAttachment(), - "aws_iam_instance_profile": resourceAwsIamInstanceProfile(), - "aws_iam_openid_connect_provider": resourceAwsIamOpenIDConnectProvider(), - "aws_iam_policy": resourceAwsIamPolicy(), - "aws_iam_policy_attachment": resourceAwsIamPolicyAttachment(), - "aws_iam_role_policy_attachment": resourceAwsIamRolePolicyAttachment(), - "aws_iam_role_policy": resourceAwsIamRolePolicy(), - "aws_iam_role": resourceAwsIamRole(), - "aws_iam_saml_provider": resourceAwsIamSamlProvider(), - "aws_iam_server_certificate": resourceAwsIAMServerCertificate(), - "aws_iam_service_linked_role": resourceAwsIamServiceLinkedRole(), - "aws_iam_user_group_membership": resourceAwsIamUserGroupMembership(), - "aws_iam_user_policy_attachment": resourceAwsIamUserPolicyAttachment(), - "aws_iam_user_policy": resourceAwsIamUserPolicy(), - "aws_iam_user_ssh_key": resourceAwsIamUserSshKey(), - "aws_iam_user": resourceAwsIamUser(), - "aws_iam_user_login_profile": resourceAwsIamUserLoginProfile(), - "aws_imagebuilder_component": resourceAwsImageBuilderComponent(), - "aws_imagebuilder_distribution_configuration": resourceAwsImageBuilderDistributionConfiguration(), - "aws_imagebuilder_image": resourceAwsImageBuilderImage(), - "aws_imagebuilder_image_pipeline": resourceAwsImageBuilderImagePipeline(), - "aws_imagebuilder_image_recipe": resourceAwsImageBuilderImageRecipe(), - "aws_imagebuilder_infrastructure_configuration": resourceAwsImageBuilderInfrastructureConfiguration(), - "aws_inspector_assessment_target": resourceAWSInspectorAssessmentTarget(), - "aws_inspector_assessment_template": resourceAWSInspectorAssessmentTemplate(), - "aws_inspector_resource_group": resourceAWSInspectorResourceGroup(), - "aws_instance": resourceAwsInstance(), - "aws_internet_gateway": resourceAwsInternetGateway(), - "aws_iot_certificate": resourceAwsIotCertificate(), - "aws_iot_policy": resourceAwsIotPolicy(), - "aws_iot_policy_attachment": resourceAwsIotPolicyAttachment(), - "aws_iot_thing": resourceAwsIotThing(), - "aws_iot_thing_principal_attachment": resourceAwsIotThingPrincipalAttachment(), - "aws_iot_thing_type": resourceAwsIotThingType(), - "aws_iot_topic_rule": resourceAwsIotTopicRule(), - "aws_iot_role_alias": resourceAwsIotRoleAlias(), - "aws_key_pair": resourceAwsKeyPair(), - "aws_kinesis_analytics_application": resourceAwsKinesisAnalyticsApplication(), - "aws_kinesisanalyticsv2_application": resourceAwsKinesisAnalyticsV2Application(), - "aws_kinesisanalyticsv2_application_snapshot": resourceAwsKinesisAnalyticsV2ApplicationSnapshot(), - "aws_kinesis_firehose_delivery_stream": resourceAwsKinesisFirehoseDeliveryStream(), - "aws_kinesis_stream": resourceAwsKinesisStream(), - "aws_kinesis_stream_consumer": resourceAwsKinesisStreamConsumer(), - "aws_kinesis_video_stream": resourceAwsKinesisVideoStream(), - "aws_kms_alias": resourceAwsKmsAlias(), - "aws_kms_external_key": resourceAwsKmsExternalKey(), - "aws_kms_grant": resourceAwsKmsGrant(), - "aws_kms_key": resourceAwsKmsKey(), - "aws_kms_ciphertext": resourceAwsKmsCiphertext(), - "aws_lakeformation_data_lake_settings": resourceAwsLakeFormationDataLakeSettings(), - "aws_lakeformation_permissions": resourceAwsLakeFormationPermissions(), - "aws_lakeformation_resource": resourceAwsLakeFormationResource(), - "aws_lambda_alias": resourceAwsLambdaAlias(), - "aws_lambda_code_signing_config": resourceAwsLambdaCodeSigningConfig(), - "aws_lambda_event_source_mapping": resourceAwsLambdaEventSourceMapping(), - "aws_lambda_function_event_invoke_config": resourceAwsLambdaFunctionEventInvokeConfig(), - "aws_lambda_function": resourceAwsLambdaFunction(), - "aws_lambda_layer_version": resourceAwsLambdaLayerVersion(), - "aws_lambda_permission": resourceAwsLambdaPermission(), - "aws_lambda_provisioned_concurrency_config": resourceAwsLambdaProvisionedConcurrencyConfig(), - "aws_launch_configuration": resourceAwsLaunchConfiguration(), - "aws_launch_template": resourceAwsLaunchTemplate(), - "aws_lex_bot": resourceAwsLexBot(), - "aws_lex_bot_alias": resourceAwsLexBotAlias(), - "aws_lex_intent": resourceAwsLexIntent(), - "aws_lex_slot_type": resourceAwsLexSlotType(), - "aws_licensemanager_association": resourceAwsLicenseManagerAssociation(), - "aws_licensemanager_license_configuration": resourceAwsLicenseManagerLicenseConfiguration(), - "aws_lightsail_domain": resourceAwsLightsailDomain(), - "aws_lightsail_instance": resourceAwsLightsailInstance(), - "aws_lightsail_instance_public_ports": resourceAwsLightsailInstancePublicPorts(), - "aws_lightsail_key_pair": resourceAwsLightsailKeyPair(), - "aws_lightsail_static_ip": resourceAwsLightsailStaticIp(), - "aws_lightsail_static_ip_attachment": resourceAwsLightsailStaticIpAttachment(), - "aws_lb_cookie_stickiness_policy": resourceAwsLBCookieStickinessPolicy(), - "aws_load_balancer_policy": resourceAwsLoadBalancerPolicy(), - "aws_load_balancer_backend_server_policy": resourceAwsLoadBalancerBackendServerPolicies(), - "aws_load_balancer_listener_policy": resourceAwsLoadBalancerListenerPolicies(), - "aws_lb_ssl_negotiation_policy": resourceAwsLBSSLNegotiationPolicy(), - "aws_macie2_account": resourceAwsMacie2Account(), - "aws_macie2_classification_job": resourceAwsMacie2ClassificationJob(), - "aws_macie2_custom_data_identifier": resourceAwsMacie2CustomDataIdentifier(), - "aws_macie2_findings_filter": resourceAwsMacie2FindingsFilter(), - "aws_macie2_invitation_accepter": resourceAwsMacie2InvitationAccepter(), - "aws_macie2_member": resourceAwsMacie2Member(), - "aws_macie2_organization_admin_account": resourceAwsMacie2OrganizationAdminAccount(), - "aws_macie_member_account_association": resourceAwsMacieMemberAccountAssociation(), - "aws_macie_s3_bucket_association": resourceAwsMacieS3BucketAssociation(), - "aws_main_route_table_association": resourceAwsMainRouteTableAssociation(), - "aws_mq_broker": resourceAwsMqBroker(), - "aws_mq_configuration": resourceAwsMqConfiguration(), - "aws_media_convert_queue": resourceAwsMediaConvertQueue(), - "aws_media_package_channel": resourceAwsMediaPackageChannel(), - "aws_media_store_container": resourceAwsMediaStoreContainer(), - "aws_media_store_container_policy": resourceAwsMediaStoreContainerPolicy(), - "aws_msk_cluster": resourceAwsMskCluster(), - "aws_msk_configuration": resourceAwsMskConfiguration(), - "aws_msk_scram_secret_association": resourceAwsMskScramSecretAssociation(), - "aws_mwaa_environment": resourceAwsMwaaEnvironment(), - "aws_nat_gateway": resourceAwsNatGateway(), - "aws_network_acl": resourceAwsNetworkAcl(), - "aws_default_network_acl": resourceAwsDefaultNetworkAcl(), - "aws_neptune_cluster": resourceAwsNeptuneCluster(), - "aws_neptune_cluster_endpoint": resourceAwsNeptuneClusterEndpoint(), - "aws_neptune_cluster_instance": resourceAwsNeptuneClusterInstance(), - "aws_neptune_cluster_parameter_group": resourceAwsNeptuneClusterParameterGroup(), - "aws_neptune_cluster_snapshot": resourceAwsNeptuneClusterSnapshot(), - "aws_neptune_event_subscription": resourceAwsNeptuneEventSubscription(), - "aws_neptune_parameter_group": resourceAwsNeptuneParameterGroup(), - "aws_neptune_subnet_group": resourceAwsNeptuneSubnetGroup(), - "aws_network_acl_rule": resourceAwsNetworkAclRule(), - "aws_network_interface": resourceAwsNetworkInterface(), - "aws_network_interface_attachment": resourceAwsNetworkInterfaceAttachment(), - "aws_networkfirewall_firewall": resourceAwsNetworkFirewallFirewall(), - "aws_networkfirewall_firewall_policy": resourceAwsNetworkFirewallFirewallPolicy(), - "aws_networkfirewall_logging_configuration": resourceAwsNetworkFirewallLoggingConfiguration(), - "aws_networkfirewall_resource_policy": resourceAwsNetworkFirewallResourcePolicy(), - "aws_networkfirewall_rule_group": resourceAwsNetworkFirewallRuleGroup(), - "aws_opsworks_application": resourceAwsOpsworksApplication(), - "aws_opsworks_stack": resourceAwsOpsworksStack(), - "aws_opsworks_java_app_layer": resourceAwsOpsworksJavaAppLayer(), - "aws_opsworks_haproxy_layer": resourceAwsOpsworksHaproxyLayer(), - "aws_opsworks_static_web_layer": resourceAwsOpsworksStaticWebLayer(), - "aws_opsworks_php_app_layer": resourceAwsOpsworksPhpAppLayer(), - "aws_opsworks_rails_app_layer": resourceAwsOpsworksRailsAppLayer(), - "aws_opsworks_nodejs_app_layer": resourceAwsOpsworksNodejsAppLayer(), - "aws_opsworks_memcached_layer": resourceAwsOpsworksMemcachedLayer(), - "aws_opsworks_mysql_layer": resourceAwsOpsworksMysqlLayer(), - "aws_opsworks_ganglia_layer": resourceAwsOpsworksGangliaLayer(), - "aws_opsworks_custom_layer": resourceAwsOpsworksCustomLayer(), - "aws_opsworks_instance": resourceAwsOpsworksInstance(), - "aws_opsworks_user_profile": resourceAwsOpsworksUserProfile(), - "aws_opsworks_permission": resourceAwsOpsworksPermission(), - "aws_opsworks_rds_db_instance": resourceAwsOpsworksRdsDbInstance(), - "aws_organizations_organization": resourceAwsOrganizationsOrganization(), - "aws_organizations_account": resourceAwsOrganizationsAccount(), - "aws_organizations_delegated_administrator": resourceAwsOrganizationsDelegatedAdministrator(), - "aws_organizations_policy": resourceAwsOrganizationsPolicy(), - "aws_organizations_policy_attachment": resourceAwsOrganizationsPolicyAttachment(), - "aws_organizations_organizational_unit": resourceAwsOrganizationsOrganizationalUnit(), - "aws_placement_group": resourceAwsPlacementGroup(), - "aws_prometheus_workspace": resourceAwsPrometheusWorkspace(), - "aws_proxy_protocol_policy": resourceAwsProxyProtocolPolicy(), - "aws_qldb_ledger": resourceAwsQLDBLedger(), - "aws_quicksight_group": resourceAwsQuickSightGroup(), - "aws_quicksight_user": resourceAwsQuickSightUser(), - "aws_ram_principal_association": resourceAwsRamPrincipalAssociation(), - "aws_ram_resource_association": resourceAwsRamResourceAssociation(), - "aws_ram_resource_share": resourceAwsRamResourceShare(), - "aws_ram_resource_share_accepter": resourceAwsRamResourceShareAccepter(), - "aws_rds_cluster": resourceAwsRDSCluster(), - "aws_rds_cluster_endpoint": resourceAwsRDSClusterEndpoint(), - "aws_rds_cluster_instance": resourceAwsRDSClusterInstance(), - "aws_rds_cluster_parameter_group": resourceAwsRDSClusterParameterGroup(), - "aws_rds_global_cluster": resourceAwsRDSGlobalCluster(), - "aws_redshift_cluster": resourceAwsRedshiftCluster(), - "aws_redshift_security_group": resourceAwsRedshiftSecurityGroup(), - "aws_redshift_parameter_group": resourceAwsRedshiftParameterGroup(), - "aws_redshift_subnet_group": resourceAwsRedshiftSubnetGroup(), - "aws_redshift_snapshot_copy_grant": resourceAwsRedshiftSnapshotCopyGrant(), - "aws_redshift_snapshot_schedule": resourceAwsRedshiftSnapshotSchedule(), - "aws_redshift_snapshot_schedule_association": resourceAwsRedshiftSnapshotScheduleAssociation(), - "aws_redshift_event_subscription": resourceAwsRedshiftEventSubscription(), - "aws_resourcegroups_group": resourceAwsResourceGroupsGroup(), - "aws_route53_delegation_set": resourceAwsRoute53DelegationSet(), - "aws_route53_hosted_zone_dnssec": resourceAwsRoute53HostedZoneDnssec(), - "aws_route53_key_signing_key": resourceAwsRoute53KeySigningKey(), - "aws_route53_query_log": resourceAwsRoute53QueryLog(), - "aws_route53_record": resourceAwsRoute53Record(), - "aws_route53_zone_association": resourceAwsRoute53ZoneAssociation(), - "aws_route53_vpc_association_authorization": resourceAwsRoute53VPCAssociationAuthorization(), - "aws_route53_zone": resourceAwsRoute53Zone(), - "aws_route53_health_check": resourceAwsRoute53HealthCheck(), - "aws_route53_resolver_dnssec_config": resourceAwsRoute53ResolverDnssecConfig(), - "aws_route53_resolver_endpoint": resourceAwsRoute53ResolverEndpoint(), - "aws_route53_resolver_firewall_config": resourceAwsRoute53ResolverFirewallConfig(), - "aws_route53_resolver_firewall_domain_list": resourceAwsRoute53ResolverFirewallDomainList(), - "aws_route53_resolver_firewall_rule": resourceAwsRoute53ResolverFirewallRule(), - "aws_route53_resolver_firewall_rule_group": resourceAwsRoute53ResolverFirewallRuleGroup(), - "aws_route53_resolver_firewall_rule_group_association": resourceAwsRoute53ResolverFirewallRuleGroupAssociation(), - "aws_route53_resolver_query_log_config": resourceAwsRoute53ResolverQueryLogConfig(), - "aws_route53_resolver_query_log_config_association": resourceAwsRoute53ResolverQueryLogConfigAssociation(), - "aws_route53_resolver_rule_association": resourceAwsRoute53ResolverRuleAssociation(), - "aws_route53_resolver_rule": resourceAwsRoute53ResolverRule(), + "aws_accessanalyzer_analyzer": resourceAwsAccessAnalyzerAnalyzer(), + "aws_acm_certificate": resourceAwsAcmCertificate(), + "aws_acm_certificate_validation": resourceAwsAcmCertificateValidation(), + "aws_acmpca_certificate_authority": resourceAwsAcmpcaCertificateAuthority(), + "aws_acmpca_certificate_authority_certificate": resourceAwsAcmpcaCertificateAuthorityCertificate(), + "aws_acmpca_certificate": resourceAwsAcmpcaCertificate(), + "aws_ami": resourceAwsAmi(), + "aws_ami_copy": resourceAwsAmiCopy(), + "aws_ami_from_instance": resourceAwsAmiFromInstance(), + "aws_ami_launch_permission": resourceAwsAmiLaunchPermission(), + "aws_amplify_app": resourceAwsAmplifyApp(), + "aws_amplify_backend_environment": resourceAwsAmplifyBackendEnvironment(), + "aws_amplify_branch": resourceAwsAmplifyBranch(), + "aws_amplify_domain_association": resourceAwsAmplifyDomainAssociation(), + "aws_amplify_webhook": resourceAwsAmplifyWebhook(), + "aws_api_gateway_account": resourceAwsApiGatewayAccount(), + "aws_api_gateway_api_key": resourceAwsApiGatewayApiKey(), + "aws_api_gateway_authorizer": resourceAwsApiGatewayAuthorizer(), + "aws_api_gateway_base_path_mapping": resourceAwsApiGatewayBasePathMapping(), + "aws_api_gateway_client_certificate": resourceAwsApiGatewayClientCertificate(), + "aws_api_gateway_deployment": resourceAwsApiGatewayDeployment(), + "aws_api_gateway_documentation_part": resourceAwsApiGatewayDocumentationPart(), + "aws_api_gateway_documentation_version": resourceAwsApiGatewayDocumentationVersion(), + "aws_api_gateway_domain_name": resourceAwsApiGatewayDomainName(), + "aws_api_gateway_gateway_response": resourceAwsApiGatewayGatewayResponse(), + "aws_api_gateway_integration": resourceAwsApiGatewayIntegration(), + "aws_api_gateway_integration_response": resourceAwsApiGatewayIntegrationResponse(), + "aws_api_gateway_method": resourceAwsApiGatewayMethod(), + "aws_api_gateway_method_response": resourceAwsApiGatewayMethodResponse(), + "aws_api_gateway_method_settings": resourceAwsApiGatewayMethodSettings(), + "aws_api_gateway_model": resourceAwsApiGatewayModel(), + "aws_api_gateway_request_validator": resourceAwsApiGatewayRequestValidator(), + "aws_api_gateway_resource": resourceAwsApiGatewayResource(), + "aws_api_gateway_rest_api": resourceAwsApiGatewayRestApi(), + "aws_api_gateway_rest_api_policy": resourceAwsApiGatewayRestApiPolicy(), + "aws_api_gateway_stage": resourceAwsApiGatewayStage(), + "aws_api_gateway_usage_plan": resourceAwsApiGatewayUsagePlan(), + "aws_api_gateway_usage_plan_key": resourceAwsApiGatewayUsagePlanKey(), + "aws_api_gateway_vpc_link": resourceAwsApiGatewayVpcLink(), + "aws_apigatewayv2_api": resourceAwsApiGatewayV2Api(), + "aws_apigatewayv2_api_mapping": resourceAwsApiGatewayV2ApiMapping(), + "aws_apigatewayv2_authorizer": resourceAwsApiGatewayV2Authorizer(), + "aws_apigatewayv2_deployment": resourceAwsApiGatewayV2Deployment(), + "aws_apigatewayv2_domain_name": resourceAwsApiGatewayV2DomainName(), + "aws_apigatewayv2_integration": resourceAwsApiGatewayV2Integration(), + "aws_apigatewayv2_integration_response": resourceAwsApiGatewayV2IntegrationResponse(), + "aws_apigatewayv2_model": resourceAwsApiGatewayV2Model(), + "aws_apigatewayv2_route": resourceAwsApiGatewayV2Route(), + "aws_apigatewayv2_route_response": resourceAwsApiGatewayV2RouteResponse(), + "aws_apigatewayv2_stage": resourceAwsApiGatewayV2Stage(), + "aws_apigatewayv2_vpc_link": resourceAwsApiGatewayV2VpcLink(), + "aws_app_cookie_stickiness_policy": resourceAwsAppCookieStickinessPolicy(), + "aws_appautoscaling_target": resourceAwsAppautoscalingTarget(), + "aws_appautoscaling_policy": resourceAwsAppautoscalingPolicy(), + "aws_appautoscaling_scheduled_action": resourceAwsAppautoscalingScheduledAction(), + "aws_appmesh_gateway_route": resourceAwsAppmeshGatewayRoute(), + "aws_appmesh_mesh": resourceAwsAppmeshMesh(), + "aws_appmesh_route": resourceAwsAppmeshRoute(), + "aws_appmesh_virtual_gateway": resourceAwsAppmeshVirtualGateway(), + "aws_appmesh_virtual_node": resourceAwsAppmeshVirtualNode(), + "aws_appmesh_virtual_router": resourceAwsAppmeshVirtualRouter(), + "aws_appmesh_virtual_service": resourceAwsAppmeshVirtualService(), + "aws_apprunner_auto_scaling_configuration_version": resourceAwsAppRunnerAutoScalingConfigurationVersion(), + "aws_apprunner_connection": resourceAwsAppRunnerConnection(), + "aws_apprunner_custom_domain_association": resourceAwsAppRunnerCustomDomainAssociation(), + "aws_apprunner_service": resourceAwsAppRunnerService(), + "aws_appsync_api_key": resourceAwsAppsyncApiKey(), + "aws_appsync_datasource": resourceAwsAppsyncDatasource(), + "aws_appsync_function": resourceAwsAppsyncFunction(), + "aws_appsync_graphql_api": resourceAwsAppsyncGraphqlApi(), + "aws_appsync_resolver": resourceAwsAppsyncResolver(), + "aws_athena_database": resourceAwsAthenaDatabase(), + "aws_athena_named_query": resourceAwsAthenaNamedQuery(), + "aws_athena_workgroup": resourceAwsAthenaWorkgroup(), + "aws_autoscaling_attachment": resourceAwsAutoscalingAttachment(), + "aws_autoscaling_group": resourceAwsAutoscalingGroup(), + "aws_autoscaling_lifecycle_hook": resourceAwsAutoscalingLifecycleHook(), + "aws_autoscaling_notification": resourceAwsAutoscalingNotification(), + "aws_autoscaling_policy": resourceAwsAutoscalingPolicy(), + "aws_autoscaling_schedule": resourceAwsAutoscalingSchedule(), + "aws_autoscalingplans_scaling_plan": resourceAwsAutoScalingPlansScalingPlan(), + "aws_backup_global_settings": resourceAwsBackupGlobalSettings(), + "aws_backup_plan": resourceAwsBackupPlan(), + "aws_backup_region_settings": resourceAwsBackupRegionSettings(), + "aws_backup_selection": resourceAwsBackupSelection(), + "aws_backup_vault": resourceAwsBackupVault(), + "aws_backup_vault_notifications": resourceAwsBackupVaultNotifications(), + "aws_backup_vault_policy": resourceAwsBackupVaultPolicy(), + "aws_budgets_budget": resourceAwsBudgetsBudget(), + "aws_budgets_budget_action": resourceAwsBudgetsBudgetAction(), + "aws_cloud9_environment_ec2": resourceAwsCloud9EnvironmentEc2(), + "aws_cloudformation_stack": resourceAwsCloudFormationStack(), + "aws_cloudformation_stack_set": resourceAwsCloudFormationStackSet(), + "aws_cloudformation_stack_set_instance": resourceAwsCloudFormationStackSetInstance(), + "aws_cloudformation_type": resourceAwsCloudFormationType(), + "aws_cloudfront_cache_policy": resourceAwsCloudFrontCachePolicy(), + "aws_cloudfront_distribution": resourceAwsCloudFrontDistribution(), + "aws_cloudfront_function": resourceAwsCloudFrontFunction(), + "aws_cloudfront_key_group": resourceAwsCloudFrontKeyGroup(), + "aws_cloudfront_monitoring_subscription": resourceAwsCloudFrontMonitoringSubscription(), + "aws_cloudfront_origin_access_identity": resourceAwsCloudFrontOriginAccessIdentity(), + "aws_cloudfront_origin_request_policy": resourceAwsCloudFrontOriginRequestPolicy(), + "aws_cloudfront_public_key": resourceAwsCloudFrontPublicKey(), + "aws_cloudfront_realtime_log_config": resourceAwsCloudFrontRealtimeLogConfig(), + "aws_cloudtrail": resourceAwsCloudTrail(), + "aws_cloudwatch_event_bus": resourceAwsCloudWatchEventBus(), + "aws_cloudwatch_event_bus_policy": resourceAwsCloudWatchEventBusPolicy(), + "aws_cloudwatch_event_permission": resourceAwsCloudWatchEventPermission(), + "aws_cloudwatch_event_rule": resourceAwsCloudWatchEventRule(), + "aws_cloudwatch_event_target": resourceAwsCloudWatchEventTarget(), + "aws_cloudwatch_event_archive": resourceAwsCloudWatchEventArchive(), + "aws_cloudwatch_event_connection": resourceAwsCloudWatchEventConnection(), + "aws_cloudwatch_event_api_destination": resourceAwsCloudWatchEventApiDestination(), + "aws_cloudwatch_log_destination": resourceAwsCloudWatchLogDestination(), + "aws_cloudwatch_log_destination_policy": resourceAwsCloudWatchLogDestinationPolicy(), + "aws_cloudwatch_log_group": resourceAwsCloudWatchLogGroup(), + "aws_cloudwatch_log_metric_filter": resourceAwsCloudWatchLogMetricFilter(), + "aws_cloudwatch_log_resource_policy": resourceAwsCloudWatchLogResourcePolicy(), + "aws_cloudwatch_log_stream": resourceAwsCloudWatchLogStream(), + "aws_cloudwatch_log_subscription_filter": resourceAwsCloudwatchLogSubscriptionFilter(), + "aws_config_aggregate_authorization": resourceAwsConfigAggregateAuthorization(), + "aws_config_config_rule": resourceAwsConfigConfigRule(), + "aws_config_configuration_aggregator": resourceAwsConfigConfigurationAggregator(), + "aws_config_configuration_recorder": resourceAwsConfigConfigurationRecorder(), + "aws_config_configuration_recorder_status": resourceAwsConfigConfigurationRecorderStatus(), + "aws_config_conformance_pack": resourceAwsConfigConformancePack(), + "aws_config_delivery_channel": resourceAwsConfigDeliveryChannel(), + "aws_config_organization_custom_rule": resourceAwsConfigOrganizationCustomRule(), + "aws_config_organization_managed_rule": resourceAwsConfigOrganizationManagedRule(), + "aws_config_remediation_configuration": resourceAwsConfigRemediationConfiguration(), + "aws_cognito_identity_pool": resourceAwsCognitoIdentityPool(), + "aws_cognito_identity_pool_roles_attachment": resourceAwsCognitoIdentityPoolRolesAttachment(), + "aws_cognito_identity_provider": resourceAwsCognitoIdentityProvider(), + "aws_cognito_resource_server": resourceAwsCognitoResourceServer(), + "aws_cognito_user_group": resourceAwsCognitoUserGroup(), + "aws_cognito_user_pool": resourceAwsCognitoUserPool(), + "aws_cognito_user_pool_client": resourceAwsCognitoUserPoolClient(), + "aws_cognito_user_pool_domain": resourceAwsCognitoUserPoolDomain(), + "aws_cognito_user_pool_ui_customization": resourceAwsCognitoUserPoolUICustomization(), + "aws_cloudhsm_v2_cluster": resourceAwsCloudHsmV2Cluster(), + "aws_cloudhsm_v2_hsm": resourceAwsCloudHsmV2Hsm(), + "aws_cloudwatch_composite_alarm": resourceAwsCloudWatchCompositeAlarm(), + "aws_cloudwatch_metric_alarm": resourceAwsCloudWatchMetricAlarm(), + "aws_cloudwatch_dashboard": resourceAwsCloudWatchDashboard(), + "aws_cloudwatch_metric_stream": resourceAwsCloudWatchMetricStream(), + "aws_cloudwatch_query_definition": resourceAwsCloudWatchQueryDefinition(), + "aws_codedeploy_app": resourceAwsCodeDeployApp(), + "aws_codedeploy_deployment_config": resourceAwsCodeDeployDeploymentConfig(), + "aws_codedeploy_deployment_group": resourceAwsCodeDeployDeploymentGroup(), + "aws_codecommit_repository": resourceAwsCodeCommitRepository(), + "aws_codecommit_trigger": resourceAwsCodeCommitTrigger(), + "aws_codeartifact_domain": resourceAwsCodeArtifactDomain(), + "aws_codeartifact_domain_permissions_policy": resourceAwsCodeArtifactDomainPermissionsPolicy(), + "aws_codeartifact_repository": resourceAwsCodeArtifactRepository(), + "aws_codeartifact_repository_permissions_policy": resourceAwsCodeArtifactRepositoryPermissionsPolicy(), + "aws_codebuild_project": resourceAwsCodeBuildProject(), + "aws_codebuild_report_group": resourceAwsCodeBuildReportGroup(), + "aws_codebuild_source_credential": resourceAwsCodeBuildSourceCredential(), + "aws_codebuild_webhook": resourceAwsCodeBuildWebhook(), + "aws_codepipeline": resourceAwsCodePipeline(), + "aws_codepipeline_webhook": resourceAwsCodePipelineWebhook(), + "aws_codestarconnections_connection": resourceAwsCodeStarConnectionsConnection(), + "aws_codestarconnections_host": resourceAwsCodeStarConnectionsHost(), + "aws_codestarnotifications_notification_rule": resourceAwsCodeStarNotificationsNotificationRule(), + "aws_cur_report_definition": resourceAwsCurReportDefinition(), + "aws_customer_gateway": resourceAwsCustomerGateway(), + "aws_datapipeline_pipeline": resourceAwsDataPipelinePipeline(), + "aws_datasync_agent": resourceAwsDataSyncAgent(), + "aws_datasync_location_efs": resourceAwsDataSyncLocationEfs(), + "aws_datasync_location_fsx_windows_file_system": resourceAwsDataSyncLocationFsxWindowsFileSystem(), + "aws_datasync_location_nfs": resourceAwsDataSyncLocationNfs(), + "aws_datasync_location_s3": resourceAwsDataSyncLocationS3(), + "aws_datasync_location_smb": resourceAwsDataSyncLocationSmb(), + "aws_datasync_task": resourceAwsDataSyncTask(), + "aws_dax_cluster": resourceAwsDaxCluster(), + "aws_dax_parameter_group": resourceAwsDaxParameterGroup(), + "aws_dax_subnet_group": resourceAwsDaxSubnetGroup(), + "aws_db_cluster_snapshot": resourceAwsDbClusterSnapshot(), + "aws_db_event_subscription": resourceAwsDbEventSubscription(), + "aws_db_instance": resourceAwsDbInstance(), + "aws_db_instance_role_association": resourceAwsDbInstanceRoleAssociation(), + "aws_db_option_group": resourceAwsDbOptionGroup(), + "aws_db_parameter_group": resourceAwsDbParameterGroup(), + "aws_db_proxy": resourceAwsDbProxy(), + "aws_db_proxy_default_target_group": resourceAwsDbProxyDefaultTargetGroup(), + "aws_db_proxy_endpoint": resourceAwsDbProxyEndpoint(), + "aws_db_proxy_target": resourceAwsDbProxyTarget(), + "aws_db_security_group": resourceAwsDbSecurityGroup(), + "aws_db_snapshot": resourceAwsDbSnapshot(), + "aws_db_subnet_group": resourceAwsDbSubnetGroup(), + "aws_devicefarm_project": resourceAwsDevicefarmProject(), + "aws_directory_service_directory": resourceAwsDirectoryServiceDirectory(), + "aws_directory_service_conditional_forwarder": resourceAwsDirectoryServiceConditionalForwarder(), + "aws_directory_service_log_subscription": resourceAwsDirectoryServiceLogSubscription(), + "aws_dlm_lifecycle_policy": resourceAwsDlmLifecyclePolicy(), + "aws_dms_certificate": resourceAwsDmsCertificate(), + "aws_dms_endpoint": resourceAwsDmsEndpoint(), + "aws_dms_event_subscription": resourceAwsDmsEventSubscription(), + "aws_dms_replication_instance": resourceAwsDmsReplicationInstance(), + "aws_dms_replication_subnet_group": resourceAwsDmsReplicationSubnetGroup(), + "aws_dms_replication_task": resourceAwsDmsReplicationTask(), + "aws_docdb_cluster": resourceAwsDocDBCluster(), + "aws_docdb_cluster_instance": resourceAwsDocDBClusterInstance(), + "aws_docdb_cluster_parameter_group": resourceAwsDocDBClusterParameterGroup(), + "aws_docdb_cluster_snapshot": resourceAwsDocDBClusterSnapshot(), + "aws_docdb_subnet_group": resourceAwsDocDBSubnetGroup(), + "aws_dx_bgp_peer": resourceAwsDxBgpPeer(), + "aws_dx_connection": resourceAwsDxConnection(), + "aws_dx_connection_association": resourceAwsDxConnectionAssociation(), + "aws_dx_gateway": resourceAwsDxGateway(), + "aws_dx_gateway_association": resourceAwsDxGatewayAssociation(), + "aws_dx_gateway_association_proposal": resourceAwsDxGatewayAssociationProposal(), + "aws_dx_hosted_private_virtual_interface": resourceAwsDxHostedPrivateVirtualInterface(), + "aws_dx_hosted_private_virtual_interface_accepter": resourceAwsDxHostedPrivateVirtualInterfaceAccepter(), + "aws_dx_hosted_public_virtual_interface": resourceAwsDxHostedPublicVirtualInterface(), + "aws_dx_hosted_public_virtual_interface_accepter": resourceAwsDxHostedPublicVirtualInterfaceAccepter(), + "aws_dx_hosted_transit_virtual_interface": resourceAwsDxHostedTransitVirtualInterface(), + "aws_dx_hosted_transit_virtual_interface_accepter": resourceAwsDxHostedTransitVirtualInterfaceAccepter(), + "aws_dx_lag": resourceAwsDxLag(), + "aws_dx_private_virtual_interface": resourceAwsDxPrivateVirtualInterface(), + "aws_dx_public_virtual_interface": resourceAwsDxPublicVirtualInterface(), + "aws_dx_transit_virtual_interface": resourceAwsDxTransitVirtualInterface(), + "aws_dynamodb_table": resourceAwsDynamoDbTable(), + "aws_dynamodb_table_item": resourceAwsDynamoDbTableItem(), + "aws_dynamodb_table_item_attribute": resourceAwsDynamoDbTableItemAttribute(), + "aws_dynamodb_global_table": resourceAwsDynamoDbGlobalTable(), + "aws_dynamodb_kinesis_streaming_destination": resourceAwsDynamoDbKinesisStreamingDestination(), + "aws_ebs_default_kms_key": resourceAwsEbsDefaultKmsKey(), + "aws_ebs_encryption_by_default": resourceAwsEbsEncryptionByDefault(), + "aws_ebs_snapshot": resourceAwsEbsSnapshot(), + "aws_ebs_snapshot_copy": resourceAwsEbsSnapshotCopy(), + "aws_ebs_volume": resourceAwsEbsVolume(), + "aws_ec2_availability_zone_group": resourceAwsEc2AvailabilityZoneGroup(), + "aws_ec2_capacity_reservation": resourceAwsEc2CapacityReservation(), + "aws_ec2_carrier_gateway": resourceAwsEc2CarrierGateway(), + "aws_ec2_client_vpn_authorization_rule": resourceAwsEc2ClientVpnAuthorizationRule(), + "aws_ec2_client_vpn_endpoint": resourceAwsEc2ClientVpnEndpoint(), + "aws_ec2_client_vpn_network_association": resourceAwsEc2ClientVpnNetworkAssociation(), + "aws_ec2_client_vpn_route": resourceAwsEc2ClientVpnRoute(), + "aws_ec2_fleet": resourceAwsEc2Fleet(), + "aws_ec2_local_gateway_route": resourceAwsEc2LocalGatewayRoute(), + "aws_ec2_local_gateway_route_table_vpc_association": resourceAwsEc2LocalGatewayRouteTableVpcAssociation(), + "aws_ec2_managed_prefix_list": resourceAwsEc2ManagedPrefixList(), + "aws_ec2_tag": resourceAwsEc2Tag(), + "aws_ec2_traffic_mirror_filter": resourceAwsEc2TrafficMirrorFilter(), + "aws_ec2_traffic_mirror_filter_rule": resourceAwsEc2TrafficMirrorFilterRule(), + "aws_ec2_traffic_mirror_target": resourceAwsEc2TrafficMirrorTarget(), + "aws_ec2_traffic_mirror_session": resourceAwsEc2TrafficMirrorSession(), + "aws_ec2_transit_gateway": resourceAwsEc2TransitGateway(), + "aws_ec2_transit_gateway_peering_attachment": resourceAwsEc2TransitGatewayPeeringAttachment(), + "aws_ec2_transit_gateway_peering_attachment_accepter": resourceAwsEc2TransitGatewayPeeringAttachmentAccepter(), + "aws_ec2_transit_gateway_prefix_list_reference": resourceAwsEc2TransitGatewayPrefixListReference(), + "aws_ec2_transit_gateway_route": resourceAwsEc2TransitGatewayRoute(), + "aws_ec2_transit_gateway_route_table": resourceAwsEc2TransitGatewayRouteTable(), + "aws_ec2_transit_gateway_route_table_association": resourceAwsEc2TransitGatewayRouteTableAssociation(), + "aws_ec2_transit_gateway_route_table_propagation": resourceAwsEc2TransitGatewayRouteTablePropagation(), + "aws_ec2_transit_gateway_vpc_attachment": resourceAwsEc2TransitGatewayVpcAttachment(), + "aws_ec2_transit_gateway_vpc_attachment_accepter": resourceAwsEc2TransitGatewayVpcAttachmentAccepter(), + "aws_ecr_lifecycle_policy": resourceAwsEcrLifecyclePolicy(), + "aws_ecrpublic_repository": resourceAwsEcrPublicRepository(), + "aws_ecr_registry_policy": resourceAwsEcrRegistryPolicy(), + "aws_ecr_replication_configuration": resourceAwsEcrReplicationConfiguration(), + "aws_ecr_repository": resourceAwsEcrRepository(), + "aws_ecr_repository_policy": resourceAwsEcrRepositoryPolicy(), + "aws_ecs_capacity_provider": resourceAwsEcsCapacityProvider(), + "aws_ecs_cluster": resourceAwsEcsCluster(), + "aws_ecs_service": resourceAwsEcsService(), + "aws_ecs_task_definition": resourceAwsEcsTaskDefinition(), + "aws_efs_access_point": resourceAwsEfsAccessPoint(), + "aws_efs_backup_policy": resourceAwsEfsBackupPolicy(), + "aws_efs_file_system": resourceAwsEfsFileSystem(), + "aws_efs_file_system_policy": resourceAwsEfsFileSystemPolicy(), + "aws_efs_mount_target": resourceAwsEfsMountTarget(), + "aws_egress_only_internet_gateway": resourceAwsEgressOnlyInternetGateway(), + "aws_eip": resourceAwsEip(), + "aws_eip_association": resourceAwsEipAssociation(), + "aws_eks_cluster": resourceAwsEksCluster(), + "aws_eks_addon": resourceAwsEksAddon(), + "aws_eks_fargate_profile": resourceAwsEksFargateProfile(), + "aws_eks_node_group": resourceAwsEksNodeGroup(), + "aws_elasticache_cluster": resourceAwsElasticacheCluster(), + "aws_elasticache_global_replication_group": resourceAwsElasticacheGlobalReplicationGroup(), + "aws_elasticache_parameter_group": resourceAwsElasticacheParameterGroup(), + "aws_elasticache_replication_group": resourceAwsElasticacheReplicationGroup(), + "aws_elasticache_security_group": resourceAwsElasticacheSecurityGroup(), + "aws_elasticache_subnet_group": resourceAwsElasticacheSubnetGroup(), + "aws_elastic_beanstalk_application": resourceAwsElasticBeanstalkApplication(), + "aws_elastic_beanstalk_application_version": resourceAwsElasticBeanstalkApplicationVersion(), + "aws_elastic_beanstalk_configuration_template": resourceAwsElasticBeanstalkConfigurationTemplate(), + "aws_elastic_beanstalk_environment": resourceAwsElasticBeanstalkEnvironment(), + "aws_elasticsearch_domain": resourceAwsElasticSearchDomain(), + "aws_elasticsearch_domain_policy": resourceAwsElasticSearchDomainPolicy(), + "aws_elasticsearch_domain_saml_options": resourceAwsElasticSearchDomainSAMLOptions(), + "aws_elastictranscoder_pipeline": resourceAwsElasticTranscoderPipeline(), + "aws_elastictranscoder_preset": resourceAwsElasticTranscoderPreset(), + "aws_elb": resourceAwsElb(), + "aws_elb_attachment": resourceAwsElbAttachment(), + "aws_emr_cluster": resourceAwsEMRCluster(), + "aws_emr_instance_group": resourceAwsEMRInstanceGroup(), + "aws_emr_instance_fleet": resourceAwsEMRInstanceFleet(), + "aws_emr_managed_scaling_policy": resourceAwsEMRManagedScalingPolicy(), + "aws_emr_security_configuration": resourceAwsEMRSecurityConfiguration(), + "aws_flow_log": resourceAwsFlowLog(), + "aws_fsx_lustre_file_system": resourceAwsFsxLustreFileSystem(), + "aws_fsx_windows_file_system": resourceAwsFsxWindowsFileSystem(), + "aws_fms_admin_account": resourceAwsFmsAdminAccount(), + "aws_fms_policy": resourceAwsFmsPolicy(), + "aws_gamelift_alias": resourceAwsGameliftAlias(), + "aws_gamelift_build": resourceAwsGameliftBuild(), + "aws_gamelift_fleet": resourceAwsGameliftFleet(), + "aws_gamelift_game_session_queue": resourceAwsGameliftGameSessionQueue(), + "aws_glacier_vault": resourceAwsGlacierVault(), + "aws_glacier_vault_lock": resourceAwsGlacierVaultLock(), + "aws_globalaccelerator_accelerator": resourceAwsGlobalAcceleratorAccelerator(), + "aws_globalaccelerator_endpoint_group": resourceAwsGlobalAcceleratorEndpointGroup(), + "aws_globalaccelerator_listener": resourceAwsGlobalAcceleratorListener(), + "aws_glue_catalog_database": resourceAwsGlueCatalogDatabase(), + "aws_glue_catalog_table": resourceAwsGlueCatalogTable(), + "aws_glue_classifier": resourceAwsGlueClassifier(), + "aws_glue_connection": resourceAwsGlueConnection(), + "aws_glue_dev_endpoint": resourceAwsGlueDevEndpoint(), + "aws_glue_crawler": resourceAwsGlueCrawler(), + "aws_glue_data_catalog_encryption_settings": resourceAwsGlueDataCatalogEncryptionSettings(), + "aws_glue_job": resourceAwsGlueJob(), + "aws_glue_ml_transform": resourceAwsGlueMLTransform(), + "aws_glue_partition": resourceAwsGluePartition(), + "aws_glue_registry": resourceAwsGlueRegistry(), + "aws_glue_resource_policy": resourceAwsGlueResourcePolicy(), + "aws_glue_schema": resourceAwsGlueSchema(), + "aws_glue_security_configuration": resourceAwsGlueSecurityConfiguration(), + "aws_glue_trigger": resourceAwsGlueTrigger(), + "aws_glue_user_defined_function": resourceAwsGlueUserDefinedFunction(), + "aws_glue_workflow": resourceAwsGlueWorkflow(), + "aws_guardduty_detector": resourceAwsGuardDutyDetector(), + "aws_guardduty_filter": resourceAwsGuardDutyFilter(), + "aws_guardduty_invite_accepter": resourceAwsGuardDutyInviteAccepter(), + "aws_guardduty_ipset": resourceAwsGuardDutyIpset(), + "aws_guardduty_member": resourceAwsGuardDutyMember(), + "aws_guardduty_organization_admin_account": resourceAwsGuardDutyOrganizationAdminAccount(), + "aws_guardduty_organization_configuration": resourceAwsGuardDutyOrganizationConfiguration(), + "aws_guardduty_publishing_destination": resourceAwsGuardDutyPublishingDestination(), + "aws_guardduty_threatintelset": resourceAwsGuardDutyThreatintelset(), + "aws_iam_access_key": resourceAwsIamAccessKey(), + "aws_iam_account_alias": resourceAwsIamAccountAlias(), + "aws_iam_account_password_policy": resourceAwsIamAccountPasswordPolicy(), + "aws_iam_group_policy": resourceAwsIamGroupPolicy(), + "aws_iam_group": resourceAwsIamGroup(), + "aws_iam_group_membership": resourceAwsIamGroupMembership(), + "aws_iam_group_policy_attachment": resourceAwsIamGroupPolicyAttachment(), + "aws_iam_instance_profile": resourceAwsIamInstanceProfile(), + "aws_iam_openid_connect_provider": resourceAwsIamOpenIDConnectProvider(), + "aws_iam_policy": resourceAwsIamPolicy(), + "aws_iam_policy_attachment": resourceAwsIamPolicyAttachment(), + "aws_iam_role_policy_attachment": resourceAwsIamRolePolicyAttachment(), + "aws_iam_role_policy": resourceAwsIamRolePolicy(), + "aws_iam_role": resourceAwsIamRole(), + "aws_iam_saml_provider": resourceAwsIamSamlProvider(), + "aws_iam_server_certificate": resourceAwsIAMServerCertificate(), + "aws_iam_service_linked_role": resourceAwsIamServiceLinkedRole(), + "aws_iam_user_group_membership": resourceAwsIamUserGroupMembership(), + "aws_iam_user_policy_attachment": resourceAwsIamUserPolicyAttachment(), + "aws_iam_user_policy": resourceAwsIamUserPolicy(), + "aws_iam_user_ssh_key": resourceAwsIamUserSshKey(), + "aws_iam_user": resourceAwsIamUser(), + "aws_iam_user_login_profile": resourceAwsIamUserLoginProfile(), + "aws_imagebuilder_component": resourceAwsImageBuilderComponent(), + "aws_imagebuilder_distribution_configuration": resourceAwsImageBuilderDistributionConfiguration(), + "aws_imagebuilder_image": resourceAwsImageBuilderImage(), + "aws_imagebuilder_image_pipeline": resourceAwsImageBuilderImagePipeline(), + "aws_imagebuilder_image_recipe": resourceAwsImageBuilderImageRecipe(), + "aws_imagebuilder_infrastructure_configuration": resourceAwsImageBuilderInfrastructureConfiguration(), + "aws_inspector_assessment_target": resourceAWSInspectorAssessmentTarget(), + "aws_inspector_assessment_template": resourceAWSInspectorAssessmentTemplate(), + "aws_inspector_resource_group": resourceAWSInspectorResourceGroup(), + "aws_instance": resourceAwsInstance(), + "aws_internet_gateway": resourceAwsInternetGateway(), + "aws_iot_certificate": resourceAwsIotCertificate(), + "aws_iot_policy": resourceAwsIotPolicy(), + "aws_iot_policy_attachment": resourceAwsIotPolicyAttachment(), + "aws_iot_thing": resourceAwsIotThing(), + "aws_iot_thing_principal_attachment": resourceAwsIotThingPrincipalAttachment(), + "aws_iot_thing_type": resourceAwsIotThingType(), + "aws_iot_topic_rule": resourceAwsIotTopicRule(), + "aws_iot_role_alias": resourceAwsIotRoleAlias(), + "aws_key_pair": resourceAwsKeyPair(), + "aws_kinesis_analytics_application": resourceAwsKinesisAnalyticsApplication(), + "aws_kinesisanalyticsv2_application": resourceAwsKinesisAnalyticsV2Application(), + "aws_kinesisanalyticsv2_application_snapshot": resourceAwsKinesisAnalyticsV2ApplicationSnapshot(), + "aws_kinesis_firehose_delivery_stream": resourceAwsKinesisFirehoseDeliveryStream(), + "aws_kinesis_stream": resourceAwsKinesisStream(), + "aws_kinesis_stream_consumer": resourceAwsKinesisStreamConsumer(), + "aws_kinesis_video_stream": resourceAwsKinesisVideoStream(), + "aws_kms_alias": resourceAwsKmsAlias(), + "aws_kms_external_key": resourceAwsKmsExternalKey(), + "aws_kms_grant": resourceAwsKmsGrant(), + "aws_kms_key": resourceAwsKmsKey(), + "aws_kms_ciphertext": resourceAwsKmsCiphertext(), + "aws_lakeformation_data_lake_settings": resourceAwsLakeFormationDataLakeSettings(), + "aws_lakeformation_permissions": resourceAwsLakeFormationPermissions(), + "aws_lakeformation_resource": resourceAwsLakeFormationResource(), + "aws_lambda_alias": resourceAwsLambdaAlias(), + "aws_lambda_code_signing_config": resourceAwsLambdaCodeSigningConfig(), + "aws_lambda_event_source_mapping": resourceAwsLambdaEventSourceMapping(), + "aws_lambda_function_event_invoke_config": resourceAwsLambdaFunctionEventInvokeConfig(), + "aws_lambda_function": resourceAwsLambdaFunction(), + "aws_lambda_layer_version": resourceAwsLambdaLayerVersion(), + "aws_lambda_permission": resourceAwsLambdaPermission(), + "aws_lambda_provisioned_concurrency_config": resourceAwsLambdaProvisionedConcurrencyConfig(), + "aws_launch_configuration": resourceAwsLaunchConfiguration(), + "aws_launch_template": resourceAwsLaunchTemplate(), + "aws_lex_bot": resourceAwsLexBot(), + "aws_lex_bot_alias": resourceAwsLexBotAlias(), + "aws_lex_intent": resourceAwsLexIntent(), + "aws_lex_slot_type": resourceAwsLexSlotType(), + "aws_licensemanager_association": resourceAwsLicenseManagerAssociation(), + "aws_licensemanager_license_configuration": resourceAwsLicenseManagerLicenseConfiguration(), + "aws_lightsail_domain": resourceAwsLightsailDomain(), + "aws_lightsail_instance": resourceAwsLightsailInstance(), + "aws_lightsail_instance_public_ports": resourceAwsLightsailInstancePublicPorts(), + "aws_lightsail_key_pair": resourceAwsLightsailKeyPair(), + "aws_lightsail_static_ip": resourceAwsLightsailStaticIp(), + "aws_lightsail_static_ip_attachment": resourceAwsLightsailStaticIpAttachment(), + "aws_lb_cookie_stickiness_policy": resourceAwsLBCookieStickinessPolicy(), + "aws_load_balancer_policy": resourceAwsLoadBalancerPolicy(), + "aws_load_balancer_backend_server_policy": resourceAwsLoadBalancerBackendServerPolicies(), + "aws_load_balancer_listener_policy": resourceAwsLoadBalancerListenerPolicies(), + "aws_lb_ssl_negotiation_policy": resourceAwsLBSSLNegotiationPolicy(), + "aws_macie2_account": resourceAwsMacie2Account(), + "aws_macie2_classification_job": resourceAwsMacie2ClassificationJob(), + "aws_macie2_custom_data_identifier": resourceAwsMacie2CustomDataIdentifier(), + "aws_macie2_findings_filter": resourceAwsMacie2FindingsFilter(), + "aws_macie2_invitation_accepter": resourceAwsMacie2InvitationAccepter(), + "aws_macie2_member": resourceAwsMacie2Member(), + "aws_macie2_organization_admin_account": resourceAwsMacie2OrganizationAdminAccount(), + "aws_macie_member_account_association": resourceAwsMacieMemberAccountAssociation(), + "aws_macie_s3_bucket_association": resourceAwsMacieS3BucketAssociation(), + "aws_main_route_table_association": resourceAwsMainRouteTableAssociation(), + "aws_mq_broker": resourceAwsMqBroker(), + "aws_mq_configuration": resourceAwsMqConfiguration(), + "aws_media_convert_queue": resourceAwsMediaConvertQueue(), + "aws_media_package_channel": resourceAwsMediaPackageChannel(), + "aws_media_store_container": resourceAwsMediaStoreContainer(), + "aws_media_store_container_policy": resourceAwsMediaStoreContainerPolicy(), + "aws_msk_cluster": resourceAwsMskCluster(), + "aws_msk_configuration": resourceAwsMskConfiguration(), + "aws_msk_scram_secret_association": resourceAwsMskScramSecretAssociation(), + "aws_mwaa_environment": resourceAwsMwaaEnvironment(), + "aws_nat_gateway": resourceAwsNatGateway(), + "aws_network_acl": resourceAwsNetworkAcl(), + "aws_default_network_acl": resourceAwsDefaultNetworkAcl(), + "aws_neptune_cluster": resourceAwsNeptuneCluster(), + "aws_neptune_cluster_endpoint": resourceAwsNeptuneClusterEndpoint(), + "aws_neptune_cluster_instance": resourceAwsNeptuneClusterInstance(), + "aws_neptune_cluster_parameter_group": resourceAwsNeptuneClusterParameterGroup(), + "aws_neptune_cluster_snapshot": resourceAwsNeptuneClusterSnapshot(), + "aws_neptune_event_subscription": resourceAwsNeptuneEventSubscription(), + "aws_neptune_parameter_group": resourceAwsNeptuneParameterGroup(), + "aws_neptune_subnet_group": resourceAwsNeptuneSubnetGroup(), + "aws_network_acl_rule": resourceAwsNetworkAclRule(), + "aws_network_interface": resourceAwsNetworkInterface(), + "aws_network_interface_attachment": resourceAwsNetworkInterfaceAttachment(), + "aws_networkfirewall_firewall": resourceAwsNetworkFirewallFirewall(), + "aws_networkfirewall_firewall_policy": resourceAwsNetworkFirewallFirewallPolicy(), + "aws_networkfirewall_logging_configuration": resourceAwsNetworkFirewallLoggingConfiguration(), + "aws_networkfirewall_resource_policy": resourceAwsNetworkFirewallResourcePolicy(), + "aws_networkfirewall_rule_group": resourceAwsNetworkFirewallRuleGroup(), + "aws_opsworks_application": resourceAwsOpsworksApplication(), + "aws_opsworks_stack": resourceAwsOpsworksStack(), + "aws_opsworks_java_app_layer": resourceAwsOpsworksJavaAppLayer(), + "aws_opsworks_haproxy_layer": resourceAwsOpsworksHaproxyLayer(), + "aws_opsworks_static_web_layer": resourceAwsOpsworksStaticWebLayer(), + "aws_opsworks_php_app_layer": resourceAwsOpsworksPhpAppLayer(), + "aws_opsworks_rails_app_layer": resourceAwsOpsworksRailsAppLayer(), + "aws_opsworks_nodejs_app_layer": resourceAwsOpsworksNodejsAppLayer(), + "aws_opsworks_memcached_layer": resourceAwsOpsworksMemcachedLayer(), + "aws_opsworks_mysql_layer": resourceAwsOpsworksMysqlLayer(), + "aws_opsworks_ganglia_layer": resourceAwsOpsworksGangliaLayer(), + "aws_opsworks_custom_layer": resourceAwsOpsworksCustomLayer(), + "aws_opsworks_instance": resourceAwsOpsworksInstance(), + "aws_opsworks_user_profile": resourceAwsOpsworksUserProfile(), + "aws_opsworks_permission": resourceAwsOpsworksPermission(), + "aws_opsworks_rds_db_instance": resourceAwsOpsworksRdsDbInstance(), + "aws_organizations_organization": resourceAwsOrganizationsOrganization(), + "aws_organizations_account": resourceAwsOrganizationsAccount(), + "aws_organizations_delegated_administrator": resourceAwsOrganizationsDelegatedAdministrator(), + "aws_organizations_policy": resourceAwsOrganizationsPolicy(), + "aws_organizations_policy_attachment": resourceAwsOrganizationsPolicyAttachment(), + "aws_organizations_organizational_unit": resourceAwsOrganizationsOrganizationalUnit(), + "aws_placement_group": resourceAwsPlacementGroup(), + "aws_prometheus_workspace": resourceAwsPrometheusWorkspace(), + "aws_proxy_protocol_policy": resourceAwsProxyProtocolPolicy(), + "aws_qldb_ledger": resourceAwsQLDBLedger(), + "aws_quicksight_group": resourceAwsQuickSightGroup(), + "aws_quicksight_user": resourceAwsQuickSightUser(), + "aws_ram_principal_association": resourceAwsRamPrincipalAssociation(), + "aws_ram_resource_association": resourceAwsRamResourceAssociation(), + "aws_ram_resource_share": resourceAwsRamResourceShare(), + "aws_ram_resource_share_accepter": resourceAwsRamResourceShareAccepter(), + "aws_rds_cluster": resourceAwsRDSCluster(), + "aws_rds_cluster_endpoint": resourceAwsRDSClusterEndpoint(), + "aws_rds_cluster_instance": resourceAwsRDSClusterInstance(), + "aws_rds_cluster_parameter_group": resourceAwsRDSClusterParameterGroup(), + "aws_rds_global_cluster": resourceAwsRDSGlobalCluster(), + "aws_redshift_cluster": resourceAwsRedshiftCluster(), + "aws_redshift_security_group": resourceAwsRedshiftSecurityGroup(), + "aws_redshift_parameter_group": resourceAwsRedshiftParameterGroup(), + "aws_redshift_subnet_group": resourceAwsRedshiftSubnetGroup(), + "aws_redshift_snapshot_copy_grant": resourceAwsRedshiftSnapshotCopyGrant(), + "aws_redshift_snapshot_schedule": resourceAwsRedshiftSnapshotSchedule(), + "aws_redshift_snapshot_schedule_association": resourceAwsRedshiftSnapshotScheduleAssociation(), + "aws_redshift_event_subscription": resourceAwsRedshiftEventSubscription(), + "aws_resourcegroups_group": resourceAwsResourceGroupsGroup(), + "aws_route53_delegation_set": resourceAwsRoute53DelegationSet(), + "aws_route53_hosted_zone_dnssec": resourceAwsRoute53HostedZoneDnssec(), + "aws_route53_key_signing_key": resourceAwsRoute53KeySigningKey(), + "aws_route53_query_log": resourceAwsRoute53QueryLog(), + "aws_route53_record": resourceAwsRoute53Record(), + "aws_route53_zone_association": resourceAwsRoute53ZoneAssociation(), + "aws_route53_vpc_association_authorization": resourceAwsRoute53VPCAssociationAuthorization(), + "aws_route53_zone": resourceAwsRoute53Zone(), + "aws_route53_health_check": resourceAwsRoute53HealthCheck(), + "aws_route53_resolver_dnssec_config": resourceAwsRoute53ResolverDnssecConfig(), + "aws_route53_resolver_endpoint": resourceAwsRoute53ResolverEndpoint(), + "aws_route53_resolver_firewall_config": resourceAwsRoute53ResolverFirewallConfig(), + "aws_route53_resolver_firewall_domain_list": resourceAwsRoute53ResolverFirewallDomainList(), + "aws_route53_resolver_firewall_rule": resourceAwsRoute53ResolverFirewallRule(), + "aws_route53_resolver_firewall_rule_group": resourceAwsRoute53ResolverFirewallRuleGroup(), + "aws_route53_resolver_firewall_rule_group_association": resourceAwsRoute53ResolverFirewallRuleGroupAssociation(), + "aws_route53_resolver_query_log_config": resourceAwsRoute53ResolverQueryLogConfig(), + "aws_route53_resolver_query_log_config_association": resourceAwsRoute53ResolverQueryLogConfigAssociation(), + "aws_route53_resolver_rule_association": resourceAwsRoute53ResolverRuleAssociation(), + "aws_route53_resolver_rule": resourceAwsRoute53ResolverRule(), "aws_route": resourceAwsRoute(), "aws_route_table": resourceAwsRouteTable(), "aws_default_route_table": resourceAwsDefaultRouteTable(), From b3884bd457d0ee99e56c7499ad5623fc1a1e45d6 Mon Sep 17 00:00:00 2001 From: Denis Blanchette Date: Wed, 1 Dec 2021 15:16:52 -0500 Subject: [PATCH 34/36] Compile on arm64 for Apple Silicon and Linux --- .github/workflows/release.yml | 2 +- .goreleaser.yml | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a88b62b0b5f0..a807e46eb37f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v1 with: - go-version: 1.16 + go-version: 1.17 id: go - name: Checkout diff --git a/.goreleaser.yml b/.goreleaser.yml index 4ae04d9c4346..d995bba92e57 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -18,6 +18,11 @@ builds: - linux goarch: - amd64 + - arm64 + ignore: + # Windows arm64 is not used and does not compile well as of writing + - goos: windows + goarch: arm64 ldflags: - -s -w -X version.ProviderVersion={{.Version}} mod_timestamp: '{{ .CommitTimestamp }}' From 4a46823cd2a412a4e6d461df9883fdea7d46c1db Mon Sep 17 00:00:00 2001 From: Denis Blanchette Date: Thu, 10 Mar 2022 10:34:39 -0500 Subject: [PATCH 35/36] Post-merge fixes --- ...ta_source_aws_s3_download_bucket_object.go | 79 ----- ...urce_aws_s3_download_bucket_object_test.go | 84 ----- ...ource_aws_dynamodb_table_item_attribute.go | 190 ----------- ..._aws_dynamodb_table_item_attribute_test.go | 310 ------------------ .../service/s3/bucket_object_data_source.go | 12 +- 5 files changed, 11 insertions(+), 664 deletions(-) delete mode 100644 aws/data_source_aws_s3_download_bucket_object.go delete mode 100644 aws/data_source_aws_s3_download_bucket_object_test.go delete mode 100644 aws/resource_aws_dynamodb_table_item_attribute.go delete mode 100644 aws/resource_aws_dynamodb_table_item_attribute_test.go diff --git a/aws/data_source_aws_s3_download_bucket_object.go b/aws/data_source_aws_s3_download_bucket_object.go deleted file mode 100644 index f6810af7f170..000000000000 --- a/aws/data_source_aws_s3_download_bucket_object.go +++ /dev/null @@ -1,79 +0,0 @@ -package aws - -import ( - "fmt" - "io/ioutil" - "log" - "os" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/s3" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -func dataSourceAwsS3DownloadBucketObject() *schema.Resource { - return &schema.Resource{ - Read: dataSourceAwsS3DownloadBucketObjectRead, - - Schema: map[string]*schema.Schema{ - "bucket": { - Type: schema.TypeString, - Required: true, - }, - "key": { - Type: schema.TypeString, - Required: true, - }, - "version_id": { - Type: schema.TypeString, - Optional: true, - }, - "filename": { - Type: schema.TypeString, - Required: true, - }, - }, - } -} - -func dataSourceAwsS3DownloadBucketObjectRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).s3conn - - bucket := d.Get("bucket").(string) - key := d.Get("key").(string) - uniqueID := bucket + "/" + key - - input := s3.GetObjectInput{ - Bucket: aws.String(bucket), - Key: aws.String(key), - } - if v, ok := d.GetOk("version_id"); ok { - input.VersionId = aws.String(v.(string)) - } - out, err := conn.GetObject(&input) - if err != nil { - return fmt.Errorf("Failed getting S3 object: %s", err) - } - - s3ObjectBytes, err := ioutil.ReadAll(out.Body) - if err != nil { - return fmt.Errorf("Failed reading content of S3 object (%s): %s", uniqueID, err) - } - log.Printf("[INFO] Saving %d bytes from S3 object %s", len(s3ObjectBytes), uniqueID) - - fileName := d.Get("filename").(string) - file, err := os.Create(fileName) - if err != nil { - return fmt.Errorf("Failed to create a file at %s: %s", fileName, err) - } - defer file.Close() - - if _, err = file.Write(s3ObjectBytes); err != nil { - return fmt.Errorf("Error writing content from s3://%s to %s: %s", uniqueID, fileName, err) - } - - d.SetId(fileName) - d.Set("version_id", out.VersionId) - - return nil -} diff --git a/aws/data_source_aws_s3_download_bucket_object_test.go b/aws/data_source_aws_s3_download_bucket_object_test.go deleted file mode 100644 index 7e51171f21fc..000000000000 --- a/aws/data_source_aws_s3_download_bucket_object_test.go +++ /dev/null @@ -1,84 +0,0 @@ -package aws - -import ( - "fmt" - "io/ioutil" - "path" - "testing" - - "github.com/aws/aws-sdk-go/service/s3" - "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 TestAccDataSourceAWSS3DownloadBucketObject_basic(t *testing.T) { - dirName, _ := ioutil.TempDir("", "") - fileName := path.Join(dirName, "testfile.txt") - rInt := acctest.RandInt() - resourceOnlyConf, conf := testAccAWSDataSourceS3DownloadObjectConfig_basic(rInt, fileName) - - var rObj s3.GetObjectOutput - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - PreventPostDestroyRefresh: true, - Steps: []resource.TestStep{ - { - Config: resourceOnlyConf, - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSS3BucketObjectExists("aws_s3_bucket_object.object", &rObj), - ), - }, - { - Config: conf, - Check: resource.ComposeTestCheckFunc( - testAccCheckAwsS3DownloadedObjectExists(fileName, "Hello World"), - resource.TestCheckResourceAttr("data.aws_s3_download_bucket_object.obj", "filename", fileName), - ), - }, - }, - }) -} - -func testAccCheckAwsS3DownloadedObjectExists(fileName string, expectedContent string) resource.TestCheckFunc { - return func(s *terraform.State) error { - content, err := ioutil.ReadFile(fileName) - if err != nil { - return fmt.Errorf("Error while reading the downloaded file: %s", err) - } - - gottenContent := string(content) - if gottenContent != expectedContent { - return fmt.Errorf("Gotten content was `%s`, not `%s` as expected", gottenContent, expectedContent) - } - - return nil - - } - -} - -func testAccAWSDataSourceS3DownloadObjectConfig_basic(randInt int, fileName string) (string, string) { - resources := fmt.Sprintf(` -resource "aws_s3_bucket" "object_bucket" { - bucket = "tf-object-test-bucket-%d" -} -resource "aws_s3_bucket_object" "object" { - bucket = "${aws_s3_bucket.object_bucket.bucket}" - key = "tf-testing-obj-%d" - content = "Hello World" -} -`, randInt, randInt) - - both := fmt.Sprintf(`%s -data "aws_s3_download_bucket_object" "obj" { - bucket = "tf-object-test-bucket-%d" - key = "tf-testing-obj-%d" - filename = "%s" -} -`, resources, randInt, randInt, fileName) - - return resources, both -} diff --git a/aws/resource_aws_dynamodb_table_item_attribute.go b/aws/resource_aws_dynamodb_table_item_attribute.go deleted file mode 100644 index 75fd9f7594ab..000000000000 --- a/aws/resource_aws_dynamodb_table_item_attribute.go +++ /dev/null @@ -1,190 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "strings" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/dynamodb" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -const ( - updateExpressionSet = "SET" - updateExpressionRemove = "REMOVE" -) - -func resourceAwsDynamoDbTableItemAttribute() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsDynamoDbTableItemAttributeUpdate, - Read: resourceAwsDynamoDbTableItemAttributeRead, - Update: resourceAwsDynamoDbTableItemAttributeUpdate, - Delete: resourceAwsDynamoDbTableItemAttributeDelete, - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "table_name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "hash_key_value": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "range_key_value": { - Type: schema.TypeString, - ForceNew: true, - Optional: true, - }, - "attribute_key": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "attribute_value": { - Type: schema.TypeString, - Required: true, - }, - }, - } -} - -func resourceAwsDynamoDbTableItemAttributeDelete(d *schema.ResourceData, meta interface{}) error { - return resourceAwsDynamoDbTableItemAttributeModify(updateExpressionRemove, d, meta) -} - -func resourceAwsDynamoDbTableItemAttributeUpdate(d *schema.ResourceData, meta interface{}) error { - if err := resourceAwsDynamoDbTableItemAttributeModify(updateExpressionSet, d, meta); err != nil { - return err - } - return resourceAwsDynamoDbTableItemAttributeRead(d, meta) -} - -func resourceAwsDynamoDbTableItemAttributeModify(action string, d *schema.ResourceData, meta interface{}) error { - log.Printf("[DEBUG] %s DynamoDB table %s", action, d.Id()) - conn := meta.(*AWSClient).dynamodbconn - - tableName := d.Get("table_name").(string) - - hashKeyValue := d.Get("hash_key_value").(string) - rangeKeyValue := d.Get("range_key_value").(string) - attributeKey := d.Get("attribute_key").(string) - attributeValue := d.Get("attribute_value").(string) - - hashKeyName, rangeKeyName, err := resourceAwsDynamoDbTableItemAttributeGetKeysInfo(conn, tableName) - if err != nil { - return err - } - - updateItemInput := &dynamodb.UpdateItemInput{ - Key: resourceAwsDynamoDbTableItemAttributeGetQueryKey(hashKeyName, hashKeyValue, rangeKeyName, rangeKeyValue), - TableName: aws.String(tableName), - } - - if d.IsNewResource() { - updateItemInput.ConditionExpression = aws.String("attribute_not_exists(#key)") - } - - updateItemInput.ExpressionAttributeNames = map[string]*string{ - "#key": aws.String(attributeKey), - } - if action == updateExpressionSet { - updateItemInput.UpdateExpression = aws.String(fmt.Sprintf("%s #key = :v", updateExpressionSet)) - updateItemInput.ExpressionAttributeValues = map[string]*dynamodb.AttributeValue{ - ":v": { - S: aws.String(attributeValue), - }, - } - } else if action == updateExpressionRemove { - updateItemInput.UpdateExpression = aws.String(fmt.Sprintf("%s #key", updateExpressionRemove)) - } - - if _, err := conn.UpdateItem(updateItemInput); err != nil { - return err - } - - id := fmt.Sprintf("%s:%s:%s:%s", tableName, hashKeyValue, rangeKeyValue, attributeKey) - d.SetId(id) - - return nil -} - -func resourceAwsDynamoDbTableItemAttributeRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).dynamodbconn - - log.Printf("[DEBUG] Loading data for DynamoDB table item attribute '%s'", d.Id()) - - idParts := strings.Split(d.Id(), ":") - tableName, hashKeyValue, rangeKeyValue, attributeKey := idParts[0], idParts[1], idParts[2], idParts[3] - - hashKeyName, rangeKeyName, err := resourceAwsDynamoDbTableItemAttributeGetKeysInfo(conn, tableName) - if err != nil { - return err - } - - result, err := conn.GetItem(&dynamodb.GetItemInput{ - ConsistentRead: aws.Bool(true), - ExpressionAttributeNames: map[string]*string{ - "#key": aws.String(attributeKey), - }, - Key: resourceAwsDynamoDbTableItemAttributeGetQueryKey(hashKeyName, hashKeyValue, rangeKeyName, rangeKeyValue), - TableName: aws.String(tableName), - ProjectionExpression: aws.String("#key"), - }) - if err != nil { - if isAWSErr(err, dynamodb.ErrCodeResourceNotFoundException, "") { - log.Printf("[WARN] Dynamodb Table Item (%s) not found, error code (404)", d.Id()) - d.SetId("") - return nil - } - - return fmt.Errorf("Error retrieving DynamoDB table item: %s", err) - } - - if result.Item == nil { - log.Printf("[WARN] Dynamodb Table Item (%s) not found", d.Id()) - d.SetId("") - return nil - } - d.Set("table_name", tableName) - d.Set("hash_key_value", hashKeyValue) - d.Set("range_key_value", rangeKeyValue) - d.Set("attribute_key", attributeKey) - d.Set("attribute_value", result.Item[attributeKey].S) - - return nil -} - -func resourceAwsDynamoDbTableItemAttributeGetKeysInfo(conn *dynamodb.DynamoDB, tableName string) (string, string, error) { - var hashKeyName, rangeKeyName string - if out, err := conn.DescribeTable(&dynamodb.DescribeTableInput{ - TableName: aws.String(tableName), - }); err == nil { - for _, key := range out.Table.KeySchema { - if *key.KeyType == dynamodb.KeyTypeHash { - hashKeyName = *key.AttributeName - } else if *key.KeyType == dynamodb.KeyTypeRange { - rangeKeyName = *key.AttributeName - } - } - } else { - return "", "", fmt.Errorf("Error describing table %s: %v", tableName, err) - } - - return hashKeyName, rangeKeyName, nil -} - -func resourceAwsDynamoDbTableItemAttributeGetQueryKey(hashKeyName string, hashKeyValue string, rangeKeyName string, rangeKeyValue string) map[string]*dynamodb.AttributeValue { - queryKey := map[string]*dynamodb.AttributeValue{ - hashKeyName: {S: aws.String(hashKeyValue)}, - } - if rangeKeyValue != "" { - queryKey[rangeKeyName] = &dynamodb.AttributeValue{S: aws.String(rangeKeyValue)} - } - return queryKey -} diff --git a/aws/resource_aws_dynamodb_table_item_attribute_test.go b/aws/resource_aws_dynamodb_table_item_attribute_test.go deleted file mode 100644 index 4bed460e928f..000000000000 --- a/aws/resource_aws_dynamodb_table_item_attribute_test.go +++ /dev/null @@ -1,310 +0,0 @@ -package aws - -import ( - "fmt" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/dynamodb" - "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" -) - -const resourceName = "aws_dynamodb_table_item_attribute.test" - -func TestAccAWSDynamoDbTableItemAttribute_basic(t *testing.T) { - tableName := fmt.Sprintf("tf-acc-test-%s", acctest.RandString(8)) - hashKey := acctest.RandString(8) - attributeKey := acctest.RandString(8) - attributeValue := acctest.RandString(8) - - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSDynamoDbItemAttributeDestroy(hashKey, ""), - Steps: []resource.TestStep{ - { - Config: testAccAWSDynamoDbItemAttributeConfigBasic(tableName, hashKey, attributeKey, attributeValue), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSDynamoDbTableItemAttributeExists(resourceName), - resource.TestCheckResourceAttr(resourceName, "table_name", tableName), - resource.TestCheckResourceAttr(resourceName, "hash_key_value", "hashKeyValue"), - resource.TestCheckResourceAttr(resourceName, "range_key_value", ""), - resource.TestCheckResourceAttr(resourceName, "attribute_key", attributeKey), - resource.TestCheckResourceAttr(resourceName, "attribute_value", attributeValue), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - }, - }, - }) -} - -func TestAccAWSDynamoDbTableItemAttribute_update(t *testing.T) { - tableName := fmt.Sprintf("tf-acc-test-%s", acctest.RandString(8)) - hashKey := acctest.RandString(8) - attributeKey := acctest.RandString(8) - attributeValue := acctest.RandString(8) - attributeValue2 := acctest.RandString(8) - - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSDynamoDbItemAttributeDestroy(hashKey, ""), - Steps: []resource.TestStep{ - { - Config: testAccAWSDynamoDbItemAttributeConfigBasic(tableName, hashKey, attributeKey, attributeValue), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSDynamoDbTableItemAttributeExists(resourceName), - resource.TestCheckResourceAttr(resourceName, "table_name", tableName), - resource.TestCheckResourceAttr(resourceName, "hash_key_value", "hashKeyValue"), - resource.TestCheckResourceAttr(resourceName, "range_key_value", ""), - resource.TestCheckResourceAttr(resourceName, "attribute_key", attributeKey), - resource.TestCheckResourceAttr(resourceName, "attribute_value", attributeValue), - ), - }, - { - Config: testAccAWSDynamoDbItemAttributeConfigBasic(tableName, hashKey, attributeKey, attributeValue2), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSDynamoDbTableItemAttributeExists(resourceName), - resource.TestCheckResourceAttr(resourceName, "table_name", tableName), - resource.TestCheckResourceAttr(resourceName, "hash_key_value", "hashKeyValue"), - resource.TestCheckResourceAttr(resourceName, "range_key_value", ""), - resource.TestCheckResourceAttr(resourceName, "attribute_key", attributeKey), - resource.TestCheckResourceAttr(resourceName, "attribute_value", attributeValue2), - ), - }, - }, - }) -} - -func TestAccAWSDynamoDbTableItemAttribute_withRangeKey(t *testing.T) { - tableName := fmt.Sprintf("tf-acc-test-%s", acctest.RandString(8)) - hashKey := acctest.RandString(8) - rangeKey := acctest.RandString(8) - attributeKey := acctest.RandString(8) - attributeValue := acctest.RandString(8) - - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSDynamoDbItemAttributeDestroy(hashKey, rangeKey), - Steps: []resource.TestStep{ - { - Config: testAccAWSDynamoDbItemAttributeConfigWithRangeKey(tableName, hashKey, rangeKey, attributeKey, attributeValue), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSDynamoDbTableItemAttributeExists(resourceName), - resource.TestCheckResourceAttr(resourceName, "table_name", tableName), - resource.TestCheckResourceAttr(resourceName, "hash_key_value", "hashKeyValue"), - resource.TestCheckResourceAttr(resourceName, "range_key_value", "rangeKeyValue"), - resource.TestCheckResourceAttr(resourceName, "attribute_key", attributeKey), - resource.TestCheckResourceAttr(resourceName, "attribute_value", attributeValue), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - }, - }, - }) -} - -func TestAccAWSDynamoDbTableItemAttribute_withRangeKey_update(t *testing.T) { - tableName := fmt.Sprintf("tf-acc-test-%s", acctest.RandString(8)) - hashKey := acctest.RandString(8) - rangeKey := acctest.RandString(8) - attributeKey := acctest.RandString(8) - attributeValue := acctest.RandString(8) - attributeValue2 := acctest.RandString(8) - - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSDynamoDbItemAttributeDestroy(hashKey, rangeKey), - Steps: []resource.TestStep{ - { - Config: testAccAWSDynamoDbItemAttributeConfigWithRangeKey(tableName, hashKey, rangeKey, attributeKey, attributeValue), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSDynamoDbTableItemAttributeExists(resourceName), - resource.TestCheckResourceAttr(resourceName, "table_name", tableName), - resource.TestCheckResourceAttr(resourceName, "hash_key_value", "hashKeyValue"), - resource.TestCheckResourceAttr(resourceName, "range_key_value", "rangeKeyValue"), - resource.TestCheckResourceAttr(resourceName, "attribute_key", attributeKey), - resource.TestCheckResourceAttr(resourceName, "attribute_value", attributeValue), - ), - }, - { - Config: testAccAWSDynamoDbItemAttributeConfigWithRangeKey(tableName, hashKey, rangeKey, attributeKey, attributeValue2), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSDynamoDbTableItemAttributeExists(resourceName), - resource.TestCheckResourceAttr(resourceName, "table_name", tableName), - resource.TestCheckResourceAttr(resourceName, "hash_key_value", "hashKeyValue"), - resource.TestCheckResourceAttr(resourceName, "range_key_value", "rangeKeyValue"), - resource.TestCheckResourceAttr(resourceName, "attribute_key", attributeKey), - resource.TestCheckResourceAttr(resourceName, "attribute_value", attributeValue2), - ), - }, - }, - }) -} - -func testAccCheckAWSDynamoDbItemAttributeDestroy(hashKeyName, rangeKeyName string) resource.TestCheckFunc { - return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*AWSClient).dynamodbconn - - for _, rs := range s.RootModule().Resources { - if rs.Type != "aws_dynamodb_table_item_attribute" { - continue - } - - attrs := rs.Primary.Attributes - - result, err := conn.GetItem(&dynamodb.GetItemInput{ - ConsistentRead: aws.Bool(true), - ExpressionAttributeNames: map[string]*string{ - "#key": aws.String(attrs["attribute_key"]), - }, - Key: resourceAwsDynamoDbTableItemAttributeGetQueryKey(hashKeyName, attrs["hash_key_value"], rangeKeyName, attrs["range_key_value"]), - ProjectionExpression: aws.String("#key"), - TableName: aws.String(attrs["table_name"]), - }) - if err != nil { - if isAWSErr(err, dynamodb.ErrCodeResourceNotFoundException, "") { - return nil - } - return fmt.Errorf("Error retrieving DynamoDB table item: %s", err) - } - if result.Item == nil { - return nil - } - - return fmt.Errorf("DynamoDB table item attribute %s still exists", rs.Primary.ID) - } - - return nil - } -} - -func testAccCheckAWSDynamoDbTableItemAttributeExists(n string) resource.TestCheckFunc { - return func(s *terraform.State) error { - rs, ok := s.RootModule().Resources[n] - if !ok { - return fmt.Errorf("Not found: %s", n) - } - - if rs.Primary.ID == "" { - return fmt.Errorf("No DynamoDB table item ID specified") - } - - conn := testAccProvider.Meta().(*AWSClient).dynamodbconn - - attrs := rs.Primary.Attributes - - hashKeyName, rangeKeyName, err := resourceAwsDynamoDbTableItemAttributeGetKeysInfo(conn, attrs["table_name"]) - if err != nil { - return err - } - - result, err := conn.GetItem(&dynamodb.GetItemInput{ - ConsistentRead: aws.Bool(true), - ExpressionAttributeNames: map[string]*string{ - "#key": aws.String(attrs["attribute_key"]), - }, - Key: resourceAwsDynamoDbTableItemAttributeGetQueryKey(hashKeyName, attrs["hash_key_value"], rangeKeyName, attrs["range_key_value"]), - ProjectionExpression: aws.String("#key"), - TableName: aws.String(attrs["table_name"]), - }) - if err != nil { - return fmt.Errorf("Problem getting table item '%s': %s", rs.Primary.ID, err) - } - - expectedValue := attrs["attribute_value"] - gottenValue := *result.Item[attrs["attribute_key"]].S - if expectedValue != gottenValue { - return fmt.Errorf("Got attribute value: %s, Expected: %s", gottenValue, expectedValue) - } - - return nil - } -} - -func testAccAWSDynamoDbItemAttributeConfigBasic(tableName, hashKey, attributeKey, attributeValue string) string { - return fmt.Sprintf(` -resource "aws_dynamodb_table" "test" { - name = "%[1]s" - read_capacity = 10 - write_capacity = 10 - hash_key = "%[2]s" - - attribute { - name = "%[2]s" - type = "S" - } -} - -resource "aws_dynamodb_table_item" "test" { - table_name = "${aws_dynamodb_table.test.name}" - hash_key = "${aws_dynamodb_table.test.hash_key}" - item = < Date: Thu, 10 Mar 2022 10:37:19 -0500 Subject: [PATCH 36/36] Update workflows --- .../acctest-terraform-lint.yml | 94 ---- .../autoremove_labels.yml | 0 .github/workflows.disabled/changelog.yml | 71 ---- .github/workflows.disabled/dependencies.yml | 74 ---- .github/workflows.disabled/documentation.yml | 54 --- .github/workflows.disabled/examples.yml | 88 ---- .github/workflows.disabled/firewatch.yml | 26 -- .../workflows.disabled/generate_changelog.yml | 28 -- .../issue-comment-created.yml | 0 .github/workflows.disabled/issues.yml | 22 - .../lock.yml | 0 .../maintainer-edit.yml | 0 .../milestone-closed.yml | 0 .github/workflows.disabled/milestone.yml | 25 -- .../post_publish.yml | 0 .github/workflows.disabled/project.yml | 15 - .github/workflows.disabled/pull_requests.yml | 57 --- .../regressions.yml | 0 .../roadmap_milestone.yml | 0 .github/workflows.disabled/snapshot.yml | 44 -- .github/workflows.disabled/stale.yml | 27 -- .github/workflows.disabled/team_slack_bot.yml | 21 - .../workflows.disabled/terraform_provider.yml | 401 ------------------ .github/workflows.disabled/website.yml | 178 -------- 24 files changed, 1225 deletions(-) delete mode 100644 .github/workflows.disabled/acctest-terraform-lint.yml rename .github/{workflows => workflows.disabled}/autoremove_labels.yml (100%) delete mode 100644 .github/workflows.disabled/changelog.yml delete mode 100644 .github/workflows.disabled/dependencies.yml delete mode 100644 .github/workflows.disabled/documentation.yml delete mode 100644 .github/workflows.disabled/examples.yml delete mode 100644 .github/workflows.disabled/firewatch.yml delete mode 100644 .github/workflows.disabled/generate_changelog.yml rename .github/{workflows => workflows.disabled}/issue-comment-created.yml (100%) delete mode 100644 .github/workflows.disabled/issues.yml rename .github/{workflows => workflows.disabled}/lock.yml (100%) rename .github/{workflows => workflows.disabled}/maintainer-edit.yml (100%) rename .github/{workflows => workflows.disabled}/milestone-closed.yml (100%) delete mode 100644 .github/workflows.disabled/milestone.yml rename .github/{workflows => workflows.disabled}/post_publish.yml (100%) delete mode 100644 .github/workflows.disabled/project.yml delete mode 100644 .github/workflows.disabled/pull_requests.yml rename .github/{workflows => workflows.disabled}/regressions.yml (100%) rename .github/{workflows => workflows.disabled}/roadmap_milestone.yml (100%) delete mode 100644 .github/workflows.disabled/snapshot.yml delete mode 100644 .github/workflows.disabled/stale.yml delete mode 100644 .github/workflows.disabled/team_slack_bot.yml delete mode 100644 .github/workflows.disabled/terraform_provider.yml delete mode 100644 .github/workflows.disabled/website.yml diff --git a/.github/workflows.disabled/acctest-terraform-lint.yml b/.github/workflows.disabled/acctest-terraform-lint.yml deleted file mode 100644 index 53766e328581..000000000000 --- a/.github/workflows.disabled/acctest-terraform-lint.yml +++ /dev/null @@ -1,94 +0,0 @@ -name: Acceptance Test Linting -on: - push: - branches: - - main - - "release/**" - pull_request: - paths: - - .github/workflows/acctest-terraform-lint.yml - - .go-version - - .tflint.hcl - - 'internal/service/**/*_test.go' - - scripts/validate-terraform.sh - - tools/go.mod - -jobs: - terrafmt: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - # See also: https://github.com/actions/setup-go/pull/62 - - run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV - - uses: actions/setup-go@v2 - with: - go-version: ${{ env.GO_VERSION }} - - uses: actions/cache@v2 - continue-on-error: true - timeout-minutes: 2 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }} - - - run: cd tools && go install github.com/katbyte/terrafmt - - - run: | - # efs/file_system_test.go: argument name is format verb and replaced with quoted string. https://github.com/katbyte/terrafmt/issues/47 - # kms/grant_test.go: argument name is format verb and replaced with quoted string. https://github.com/katbyte/terrafmt/issues/47 - # quicksight/user_test.go: format verb as resource name (%[1]q). https://github.com/katbyte/terrafmt/issues/48 - # sns/platform_application_test.go: argument name is format verb and replaced with quoted string. https://github.com/katbyte/terrafmt/issues/47 - find ./internal/service -type f -name '*_test.go' \ - | sort -u \ - | grep -v efs/file_system_test.go \ - | grep -v kms/grant_test.go \ - | grep -v quicksight/user_test.go \ - | grep -v sns/platform_application_test.go \ - | xargs -I {} terrafmt diff --check --fmtcompat {} - - validate-terraform: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - # See also: https://github.com/actions/setup-go/pull/62 - - run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV - - uses: actions/setup-go@v2 - with: - go-version: ${{ env.GO_VERSION }} - - uses: actions/cache@v2 - continue-on-error: true - timeout-minutes: 2 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }} - - - run: cd tools && go install github.com/katbyte/terrafmt - - - run: cd tools && go install github.com/terraform-linters/tflint - - - uses: actions/cache@v2 - name: Cache plugin dir - with: - path: ~/.tflint.d/plugins - key: ${{ matrix.os }}-tflint-${{ hashFiles('.tflint.hcl') }} - - - run: tflint --init - - - run: | - # efs/file_system_test.go: argument name is format verb and replaced with quoted string. https://github.com/katbyte/terrafmt/issues/47 - # kms/grant_test.go: argument name is format verb and replaced with quoted string. https://github.com/katbyte/terrafmt/issues/47 - # lambda/permission_test.go: format verb as resource name ("%s"). https://github.com/katbyte/terrafmt/issues/48 - # quicksight/user_test.go: format verb as resource name (%[1]q). https://github.com/katbyte/terrafmt/issues/48 - # sns/platform_application_test.go: argument name is format verb and replaced with quoted string. https://github.com/katbyte/terrafmt/issues/47 - - # resource_aws_efs_file_system_test.go: argument name is format verb and replaced with quoted string. https://github.com/katbyte/terrafmt/issues/47 - # resource_aws_kms_grant_test.go: argument name is format verb and replaced with quoted string. https://github.com/katbyte/terrafmt/issues/47 - # resource_aws_quicksight_user_test.go: format verb as resource name (%[1]q). https://github.com/katbyte/terrafmt/issues/48 - # resource_aws_sns_platform_application_test.go: argument name is format verb and replaced with quoted string. https://github.com/katbyte/terrafmt/issues/47 - find ./internal/service -type f -name '*_test.go' \ - | sort -u \ - | grep -v efs/file_system_test.go \ - | grep -v kms/grant_test.go \ - | grep -v lambda/permission_test.go \ - | grep -v quicksight/user_test.go \ - | grep -v sns/platform_application_test.go \ - | ./scripts/validate-terraform.sh diff --git a/.github/workflows/autoremove_labels.yml b/.github/workflows.disabled/autoremove_labels.yml similarity index 100% rename from .github/workflows/autoremove_labels.yml rename to .github/workflows.disabled/autoremove_labels.yml diff --git a/.github/workflows.disabled/changelog.yml b/.github/workflows.disabled/changelog.yml deleted file mode 100644 index 60efe4a5dcd4..000000000000 --- a/.github/workflows.disabled/changelog.yml +++ /dev/null @@ -1,71 +0,0 @@ -name: CHANGELOG Checks -on: - push: - branches: - - main - - 'release/**' - pull_request: - paths: - - .changelog/* - - .go-version - - CHANGELOG.md - pull_request_target: - -jobs: - changes: - if: github.event_name == 'pull_request_target' && !contains(fromJSON('["anGie44", "breathingdust", "ewbankkit", "gdavison", "justinretzolk", "maryelizbeth", "YakDriver", "zhelding", "johnsonaj"]'), github.actor) - name: Filter Changes - runs-on: ubuntu-latest - outputs: - changed: ${{ steps.filter.outputs.changed }} - steps: - - uses: dorny/paths-filter@v2 - id: filter - with: - filters: | - changed: - - CHANGELOG.md - comment: - needs: changes - if: ${{ needs.changes.outputs.changed == 'true' }} - name: Comment - runs-on: ubuntu-latest - steps: - - name: Find Existing PR Comment - id: prc - uses: peter-evans/find-comment@v1 - with: - issue-number: ${{ github.event.pull_request.number }} - comment-author: "github-actions[bot]" - body-includes: "Please note that the `CHANGELOG.md` file contents are handled by the maintainers during merge" - - run: echo ${{ steps.prc.outputs.comment-id }} - - name: PR Comment - if: ${{ steps.prc.outputs.comment-id == '' }} - uses: peter-evans/create-or-update-comment@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - issue-number: ${{ github.event.pull_request.number }} - body: |- - Thank you for your contribution! :rocket: - - Please note that the `CHANGELOG.md` file contents are handled by the maintainers during merge. This is to prevent pull request merge conflicts, especially for contributions which may not be merged immediately. Please see the [Contributing Guide](https://github.com/hashicorp/terraform-provider-aws/blob/main/docs/contributing) for additional pull request review items. - - Remove any changes to the `CHANGELOG.md` file and commit them in this pull request to prevent delays with reviewing and potentially merging this pull request. - misspell: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - # See also: https://github.com/actions/setup-go/pull/62 - - run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV - - uses: actions/setup-go@v2 - with: - go-version: ${{ env.GO_VERSION }} - - uses: actions/cache@v2 - continue-on-error: true - timeout-minutes: 2 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }} - - run: cd tools && go install github.com/client9/misspell/cmd/misspell - - run: misspell -error -source text CHANGELOG.md .changelog diff --git a/.github/workflows.disabled/dependencies.yml b/.github/workflows.disabled/dependencies.yml deleted file mode 100644 index 0531f794d9e4..000000000000 --- a/.github/workflows.disabled/dependencies.yml +++ /dev/null @@ -1,74 +0,0 @@ -name: Dependency Checks - -on: - push: - branches: - - main - - 'release/**' - pull_request_target: - -jobs: - changes: - if: github.event_name == 'pull_request_target' && !contains(fromJSON('["anGie44", "bflad", "breathingdust", "dependabot[bot]", "DrFaust92", "ewbankkit", "gdavison", "justinretzolk", "maryelizbeth", "YakDriver", "zhelding", "johnsonaj"]'), github.actor) - name: Filter Changes - runs-on: ubuntu-latest - outputs: - changed: ${{ steps.filter.outputs.changed }} - steps: - - uses: dorny/paths-filter@v2 - id: filter - with: - filters: | - changed: - - providerlint/** - - go.mod - - go.sum - comment: - needs: changes - if: ${{ needs.changes.outputs.changed == 'true' }} - name: Comment - runs-on: ubuntu-latest - steps: - - name: Find Existing PR Comment - id: prc - uses: peter-evans/find-comment@v1 - with: - issue-number: ${{ github.event.pull_request.number }} - comment-author: "github-actions[bot]" - body-includes: "Please note that typically Go dependency changes" - - run: echo ${{ steps.prc.outputs.comment-id }} - - name: PR Comment - if: ${{ steps.prc.outputs.comment-id == '' }} - uses: peter-evans/create-or-update-comment@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - issue-number: ${{ github.event.pull_request.number }} - body: |- - Thank you for your contribution! :rocket: - - Please note that typically Go dependency changes are handled in this repository by dependabot or the maintainers. This is to prevent pull request merge conflicts and further delay reviews of contributions. Remove any changes to the `go.mod` or `go.sum` files and commit them into this pull request. - - Additional details: - - * Check [open pull requests with the `dependencies` label](https://github.com/hashicorp/terraform-provider-aws/pulls?q=is%3Aopen+is%3Apr+label%3Adependencies) to view other dependency updates. - * If this pull request includes an update the AWS Go SDK (or any other dependency) version, only updates submitted via dependabot will be merged. This pull request will need to remove these changes and will need to be rebased after the existing dependency update via dependabot has been merged for this pull request to be reviewed. - * If this pull request is for supporting a new AWS service: - * Ensure the new AWS service changes are following the [Contributing Guide section on new services](https://github.com/hashicorp/terraform-provider-aws/blob/main/docs/contributing/contribution-checklists.md#new-service), in particular that the dependency addition and initial provider support are in a separate pull request from other changes (e.g. new resources). Contributions not following this item will not be reviewed until the changes are split. - * If this pull request is already a separate pull request from the above item, you can ignore this message. - go_mod: - name: go mod - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - # See also: https://github.com/actions/setup-go/pull/62 - - run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV - - uses: actions/setup-go@v2 - with: - go-version: ${{ env.GO_VERSION }} - - name: go mod - run: | - echo "==> Checking source code with go mod tidy..." - go mod tidy - git diff --exit-code -- go.mod go.sum || \ - (echo; echo "Unexpected difference in go.mod/go.sum files. Run 'go mod tidy' command or revert any go.mod/go.sum changes and commit."; exit 1) diff --git a/.github/workflows.disabled/documentation.yml b/.github/workflows.disabled/documentation.yml deleted file mode 100644 index d04a78fc6a98..000000000000 --- a/.github/workflows.disabled/documentation.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: Documentation Checks -on: - push: - branches: - - main - pull_request: - paths: - - .markdownlinkcheck.json - - .markdownlint.yml - - .github/workflows/documentation.yml - - .go-version - - docs/** - -jobs: - markdown-link-check: - runs-on: ubuntu-latest - env: - UV_THREADPOOL_SIZE: 128 - steps: - - uses: actions/checkout@v3 - - uses: gaurav-nelson/github-action-markdown-link-check@v1 - with: - use-quiet-mode: 'yes' - use-verbose-mode: 'yes' - config-file: '.markdownlinkcheck.json' - folder-path: 'docs' - file-extension: '.md' - base-branch: "main" - check-modified-files-only: "yes" - markdown-lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: avto-dev/markdown-lint@v1 - with: - config: '.markdownlint.yml' - args: 'docs' - misspell: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - # See also: https://github.com/actions/setup-go/pull/62 - - run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV - - uses: actions/setup-go@v2 - with: - go-version: ${{ env.GO_VERSION }} - - uses: actions/cache@v2 - continue-on-error: true - timeout-minutes: 2 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }} - - run: cd tools && go install github.com/client9/misspell/cmd/misspell - - run: misspell -error -source text docs/ diff --git a/.github/workflows.disabled/examples.yml b/.github/workflows.disabled/examples.yml deleted file mode 100644 index 83079dbe8345..000000000000 --- a/.github/workflows.disabled/examples.yml +++ /dev/null @@ -1,88 +0,0 @@ -name: Examples Checks -on: - push: - branches: - - main - pull_request: - paths: - - .github/workflows/examples.yml - - .go-version - - .tflint.hcl - - examples/** - - tools/go.mod - -env: - AWS_DEFAULT_REGION: us-west-2 - -jobs: - validate-terraform: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - terraform_version: ["0.12.31", "1.0.6"] - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - uses: actions/cache@v2 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }} - # See also: https://github.com/actions/setup-go/pull/62 - - run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV - - uses: actions/setup-go@v2 - with: - go-version: ${{ env.GO_VERSION }} - - name: go build - run: go build -o terraform-plugin-dir/terraform-provider-aws_v99.99.99_x5 . - - name: override plugin - run: | - # For Terraform v0.12 - mkdir -p ~/.terraform.d/plugins - cp terraform-plugin-dir/terraform-provider-aws_v99.99.99_x5 ~/.terraform.d/plugins - # For newer versions - mkdir -p ~/.terraform.d/plugins/registry.terraform.io/hashicorp/aws/99.99.99/$(go env GOOS)_$(go env GOARCH)/ - cp terraform-plugin-dir/terraform-provider-aws_v99.99.99_x5 ~/.terraform.d/plugins/registry.terraform.io/hashicorp/aws/99.99.99/$(go env GOOS)_$(go env GOARCH)/ - - uses: hashicorp/setup-terraform@v1 - with: - terraform_version: ${{ matrix.terraform_version }} - # Needed to use the output of `terraform validate -json` - terraform_wrapper: false - - - name: install tflint - run: cd tools && go install github.com/terraform-linters/tflint - - - uses: actions/cache@v2 - name: Cache plugin dir - with: - path: ~/.tflint.d/plugins - key: ${{ matrix.os }}-tflint-${{ hashFiles('.tflint.hcl') }} - - - name: terraform - run: | - TFLINT_CONFIG="$(pwd -P)/.tflint.hcl" - for DIR in $(find ./examples -type f -name '*.tf' -exec dirname {} \; | sort -u); do - pushd "$DIR" - if [ -f terraform.template.tfvars ]; then - cp terraform.template.tfvars terraform.tfvars - fi - echo; echo -e "\e[1;35m===> Initializing Example: $DIR <===\e[0m"; echo - terraform init - echo; echo -e "\e[1;35m===> Format Checking Example: $DIR <===\e[0m"; echo - terraform fmt -check - echo; echo -e "\e[1;35m===> Validating Example: $DIR <===\e[0m"; echo - # Catch errors - terraform validate - # Terraform syntax checks - # We don't want to exit on the first tflint error - set +e - tflint --config=$TFLINT_CONFIG \ - --enable-rule=terraform_deprecated_interpolation \ - --enable-rule=terraform_deprecated_index \ - --enable-rule=terraform_unused_declarations \ - --enable-rule=terraform_comment_syntax \ - --enable-rule=terraform_required_version - set -e - popd - done diff --git a/.github/workflows.disabled/firewatch.yml b/.github/workflows.disabled/firewatch.yml deleted file mode 100644 index f4d264ed0cde..000000000000 --- a/.github/workflows.disabled/firewatch.yml +++ /dev/null @@ -1,26 +0,0 @@ - -on: - schedule: - - cron: '0 * * * *' - workflow_dispatch: -name: Firewatch -jobs: - FirewatchJob: - if: github.repository_owner == 'hashicorp' - runs-on: ubuntu-latest - steps: - - name: Firewatch - uses: breathingdust/firewatch@v2 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - alert_threshold: 10 - issue_age_months: 3 - slack_token: ${{ secrets.SLACK_BOT_TOKEN }} - slack_channel: ${{ secrets.SLACK_CHANNEL }} - - name: UploadArtifact - uses: actions/upload-artifact@v2 - with: - name: firewatch - path: firewatch.data - if-no-files-found: error - retention-days: 1 diff --git a/.github/workflows.disabled/generate_changelog.yml b/.github/workflows.disabled/generate_changelog.yml deleted file mode 100644 index f0005a797921..000000000000 --- a/.github/workflows.disabled/generate_changelog.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Generate CHANGELOG -on: - pull_request: - types: [closed] - workflow_dispatch: -jobs: - GenerateChangelog: - if: github.event.pull_request.merged || github.event_name == 'workflow_dispatch' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - run: cd tools && go install github.com/hashicorp/go-changelog/cmd/changelog-build - - run: ./scripts/generate-changelog.sh - - run: | - if [[ `git status --porcelain` ]]; then - if ${{github.event_name == 'workflow_dispatch'}}; then - MSG="Update CHANGELOG.md (Manual Trigger)" - else - MSG="Update CHANGELOG.md for #${{ github.event.pull_request.number }}" - fi - git config --local user.email changelogbot@hashicorp.com - git config --local user.name changelogbot - git add CHANGELOG.md - git commit -m "$MSG" - git push - fi diff --git a/.github/workflows/issue-comment-created.yml b/.github/workflows.disabled/issue-comment-created.yml similarity index 100% rename from .github/workflows/issue-comment-created.yml rename to .github/workflows.disabled/issue-comment-created.yml diff --git a/.github/workflows.disabled/issues.yml b/.github/workflows.disabled/issues.yml deleted file mode 100644 index 78ae3093b0ff..000000000000 --- a/.github/workflows.disabled/issues.yml +++ /dev/null @@ -1,22 +0,0 @@ -on: - issues: - types: [opened] -name: Issue triage -jobs: - markIssuesForTriage: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Apply Issue needs-triage Label - if: github.event.action == 'opened' && !contains(fromJSON('["anGie44", "bflad", "breathingdust", "DrFaust92", "ewbankkit", "gdavison", "justinretzolk", "maryelizbeth", "YakDriver", "zhelding", "johnsonaj"]'), github.actor) - uses: github/issue-labeler@v2.4 - with: - repo-token: "${{ secrets.GITHUB_TOKEN }}" - configuration-path: .github/labeler-issue-needs-triage.yml - enable-versioned-regex: 0 - - name: Apply Issue Triage Labels - uses: github/issue-labeler@v2.4 - with: - repo-token: "${{ secrets.GITHUB_TOKEN }}" - configuration-path: .github/labeler-issue-triage.yml - enable-versioned-regex: 0 diff --git a/.github/workflows/lock.yml b/.github/workflows.disabled/lock.yml similarity index 100% rename from .github/workflows/lock.yml rename to .github/workflows.disabled/lock.yml diff --git a/.github/workflows/maintainer-edit.yml b/.github/workflows.disabled/maintainer-edit.yml similarity index 100% rename from .github/workflows/maintainer-edit.yml rename to .github/workflows.disabled/maintainer-edit.yml diff --git a/.github/workflows/milestone-closed.yml b/.github/workflows.disabled/milestone-closed.yml similarity index 100% rename from .github/workflows/milestone-closed.yml rename to .github/workflows.disabled/milestone-closed.yml diff --git a/.github/workflows.disabled/milestone.yml b/.github/workflows.disabled/milestone.yml deleted file mode 100644 index 5a791ff93985..000000000000 --- a/.github/workflows.disabled/milestone.yml +++ /dev/null @@ -1,25 +0,0 @@ -on: - pull_request_target: - types: [closed] -name: Add merged PR and linked issues to current milestone of target branch -jobs: - AddMergedToCurrentMilestone: - if: github.event.pull_request.merged - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - ref: ${{ github.event.pull_request.base.ref }} - - id: get-current-milestone - run: | - echo ::set-output name=current_milestone::v$(head -1 CHANGELOG.md | cut -d " " -f 2) - - run: echo ${{ steps.get-current-milestone.outputs.current_milestone }} - - id: get-milestone-id - run: | - echo ::set-output name=milestone_id::$(curl -H "Authorization: Bearer ${{secrets.GITHUB_TOKEN}}" https://api.github.com/repos/${{ github.repository_owner }}/${{ github.event.repository.name }}/milestones | jq 'map(select(.title == "${{ steps.get-current-milestone.outputs.current_milestone }}"))[0].number') - - run: echo ${{ steps.get-milestone-id.outputs.milestone_id }} - - uses: breathingdust/current-milestone-action@v4 - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - pull_number: ${{ github.event.pull_request.number }} - milestone_number: ${{ steps.get-milestone-id.outputs.milestone_id }} diff --git a/.github/workflows/post_publish.yml b/.github/workflows.disabled/post_publish.yml similarity index 100% rename from .github/workflows/post_publish.yml rename to .github/workflows.disabled/post_publish.yml diff --git a/.github/workflows.disabled/project.yml b/.github/workflows.disabled/project.yml deleted file mode 100644 index 1d6dc3161058..000000000000 --- a/.github/workflows.disabled/project.yml +++ /dev/null @@ -1,15 +0,0 @@ -on: - pull_request_target: - types: [opened, ready_for_review] -name: Pull Request Project Automation -jobs: - WorkingBoardReview: - runs-on: ubuntu-latest - steps: - - name: Move team PRs to Review column - uses: alex-page/github-project-automation-plus@v0.8.1 - if: contains(fromJSON('["anGie44", "breathingdust", "ewbankkit", "gdavison", "maryelizbeth", "YakDriver", "zhelding", "johnsonaj"]'), github.actor) && github.event.pull_request.draft == false - with: - project: AWS Provider Working Board - column: Open Maintainer PR - repo-token: ${{ secrets.ORGSCOPED_GITHUB_TOKEN}} diff --git a/.github/workflows.disabled/pull_requests.yml b/.github/workflows.disabled/pull_requests.yml deleted file mode 100644 index c55724f730b4..000000000000 --- a/.github/workflows.disabled/pull_requests.yml +++ /dev/null @@ -1,57 +0,0 @@ -on: - - pull_request_target - -name: Pull Request Target (All types) -jobs: - Labeler: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Apply Labels - uses: actions/labeler@v4 - with: - configuration-path: .github/labeler-pr-triage.yml - repo-token: ${{ secrets.GITHUB_TOKEN }} - NeedsTriageLabeler: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Apply needs-triage Label - uses: actions/labeler@v4 - if: github.event.action == 'opened' && !contains(fromJSON('["anGie44", "bflad", "breathingdust", "dependabot[bot]", "DrFaust92", "ewbankkit", "gdavison", "justinretzolk", "maryelizbeth", "YakDriver", "zhelding", "johnsonaj"]'), github.actor) - with: - configuration-path: .github/labeler-pr-needs-triage.yml - repo-token: ${{ secrets.GITHUB_TOKEN }} - SizeLabeler: - runs-on: ubuntu-latest - steps: - # See also: https://github.com/CodelyTV/pr-size-labeler/pull/26 - - name: Apply Size Label - uses: bflad/pr-size-labeler@7df62b12a176513631973abfe151d2b6213c3f12 - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - xs_label: 'size/XS' - xs_max_size: '30' - s_label: 'size/S' - s_max_size: '60' - m_label: 'size/M' - m_max_size: '150' - l_label: 'size/L' - l_max_size: '300' - xl_label: 'size/XL' - message_if_xl: '' - PullRequestComments: - runs-on: ubuntu-latest - steps: - - name: Add comment to add helpful context for new contributors - uses: actions/first-interaction@v1 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - pr-message: |- - Welcome @${{github.actor}} :wave: - - It looks like this is your first Pull Request submission to the [Terraform AWS Provider](https://github.com/hashicorp/terraform-provider-aws)! If you haven’t already done so please make sure you have checked out our [CONTRIBUTING](https://github.com/hashicorp/terraform-provider-aws/blob/main/docs/contributing) guide and [FAQ](https://github.com/hashicorp/terraform-provider-aws/blob/main/docs/contributing/faq.md) to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval. - - Also take a look at our [FAQ](https://github.com/hashicorp/terraform-provider-aws/blob/main/docs/contributing/faq.md) which details how we prioritize Pull Requests for inclusion. - - Thanks again, and welcome to the community! :smiley: diff --git a/.github/workflows/regressions.yml b/.github/workflows.disabled/regressions.yml similarity index 100% rename from .github/workflows/regressions.yml rename to .github/workflows.disabled/regressions.yml diff --git a/.github/workflows/roadmap_milestone.yml b/.github/workflows.disabled/roadmap_milestone.yml similarity index 100% rename from .github/workflows/roadmap_milestone.yml rename to .github/workflows.disabled/roadmap_milestone.yml diff --git a/.github/workflows.disabled/snapshot.yml b/.github/workflows.disabled/snapshot.yml deleted file mode 100644 index 22b6d150712a..000000000000 --- a/.github/workflows.disabled/snapshot.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Snapshot - -on: - schedule: - - cron: '15 5 * * *' - workflow_dispatch: - -jobs: - goreleaser: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - # See also: https://github.com/actions/setup-go/pull/62 - - run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV - - uses: actions/setup-go@v2 - with: - go-version: ${{ env.GO_VERSION }} - - uses: actions/cache@v2 - continue-on-error: true - timeout-minutes: 2 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }} - - name: goreleaser release - uses: goreleaser/goreleaser-action@v2 - with: - args: release --rm-dist --skip-sign --snapshot --timeout 2h - - name: artifact naming - id: naming - run: | - case $GITHUB_REF in - refs/heads/*) - ARTIFACT="${GITHUB_REF#refs/heads/}";; - refs/pull/*) - ARTIFACT="pr-${GITHUB_REF#refs/pull/}" - ARTIFACT="${ARTIFACT%/merge}";; - *) - ARTIFACT="${GITHUB_REF}";; - esac - echo "::set-output name=artifact::$ARTIFACT-$(date -u +'%Y-%m-%dT%H-%M')" - - uses: actions/upload-artifact@v2 - with: - name: ${{steps.naming.outputs.artifact}} - path: dist/*.zip diff --git a/.github/workflows.disabled/stale.yml b/.github/workflows.disabled/stale.yml deleted file mode 100644 index dd0f8129af3f..000000000000 --- a/.github/workflows.disabled/stale.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: "Stale issues and pull requests" -on: - schedule: - - cron: "40 17 * * *" - -jobs: - stale: - runs-on: ubuntu-latest - steps: - - uses: actions/stale@v4 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - days-before-stale: 720 - days-before-close: 30 - exempt-issue-labels: 'needs-triage' - exempt-pr-labels: 'needs-triage' - operations-per-run: 125 - stale-issue-label: 'stale' - stale-issue-message: | - Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label. - - If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you! - stale-pr-label: 'stale' - stale-pr-message: | - Marking this pull request as stale due to inactivity. This helps our maintainers find and focus on the active pull requests. If this pull request receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label. - - If this pull request was automatically closed and you feel this pull request should be reopened, we encourage creating a new pull request linking back to this one for added context. Thank you! diff --git a/.github/workflows.disabled/team_slack_bot.yml b/.github/workflows.disabled/team_slack_bot.yml deleted file mode 100644 index 4dbfc3e4f46a..000000000000 --- a/.github/workflows.disabled/team_slack_bot.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: team-slack-bot - -on: - schedule: - - cron: '0 15 * * 1-5' - -jobs: - open-pr-stats: - runs-on: ubuntu-latest - name: open-pr-stats - if: github.repository_owner == 'hashicorp' - steps: - - name: open-pr-stats - uses: breathingdust/github-team-slackbot@v17 - with: - github_token: ${{ secrets.ORGSCOPED_GITHUB_TOKEN}} - org: hashicorp - repo: terraform-provider-aws - team_slug: terraform-aws - slack_token: ${{ secrets.SLACK_BOT_TOKEN }} - slack_channel: ${{ secrets.SLACK_CHANNEL }} diff --git a/.github/workflows.disabled/terraform_provider.yml b/.github/workflows.disabled/terraform_provider.yml deleted file mode 100644 index 45a750bd956d..000000000000 --- a/.github/workflows.disabled/terraform_provider.yml +++ /dev/null @@ -1,401 +0,0 @@ -name: Terraform Provider Checks - -on: - push: - branches: - - main - - 'release/**' - pull_request: - paths: - - .github/workflows/terraform_provider.yml - - .go-version - - .golangci.yml - - .semgrep.yml - - internal/** - - providerlint/** - - docs/index.md - - docs/data-sources/** - - docs/guides/** - - docs/resources/** - - go.sum - - GNUmakefile - - main.go - - staticcheck.conf - - tools/** - - website/** - -env: - AWS_DEFAULT_REGION: us-west-2 - TERRAFORM_VERSION: "1.0.6" - -jobs: - go_mod_download: - name: go mod download - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - # See also: https://github.com/actions/setup-go/pull/62 - - run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV - - uses: actions/setup-go@v2 - with: - go-version: ${{ env.GO_VERSION }} - - uses: actions/cache@v2 - continue-on-error: true - id: cache-go-pkg-mod - timeout-minutes: 2 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }} - - if: steps.cache-go-pkg-mod.outputs.cache-hit != 'true' || steps.cache-go-pkg-mod.outcome == 'failure' - run: go mod download - - go_build: - name: go build - needs: [go_mod_download] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/cache@v2 - continue-on-error: true - id: cache-terraform-plugin-dir - timeout-minutes: 2 - with: - path: terraform-plugin-dir - key: ${{ runner.os }}-terraform-plugin-dir-${{ hashFiles('go.sum') }}-${{ hashFiles('internal/**') }} - # See also: https://github.com/actions/setup-go/pull/62 - - run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV - - if: steps.cache-terraform-plugin-dir.outputs.cache-hit != 'true' || steps.cache-terraform-plugin-dir.outcome == 'failure' - uses: actions/setup-go@v2 - with: - go-version: ${{ env.GO_VERSION }} - # See also: https://github.com/actions/setup-go/issues/54 - - if: steps.cache-terraform-plugin-dir.outputs.cache-hit != 'true' || steps.cache-terraform-plugin-dir.outcome == 'failure' - name: go env - run: | - echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV - - if: steps.cache-terraform-plugin-dir.outputs.cache-hit != 'true' || steps.cache-terraform-plugin-dir.outcome == 'failure' - uses: actions/cache@v2 - with: - path: ${{ env.GOCACHE }} - key: ${{ runner.os }}-GOCACHE-${{ hashFiles('go.sum') }}-${{ hashFiles('internal/**') }} - - if: steps.cache-terraform-plugin-dir.outputs.cache-hit != 'true' || steps.cache-terraform-plugin-dir.outcome == 'failure' - uses: actions/cache@v2 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }} - - if: steps.cache-terraform-plugin-dir.outputs.cache-hit != 'true' || steps.cache-terraform-plugin-dir.outcome == 'failure' - name: go build - run: go build -o terraform-plugin-dir/registry.terraform.io/hashicorp/aws/99.99.99/$(go env GOOS)_$(go env GOARCH)/terraform-provider-aws . - - terraform_providers_schema: - name: terraform providers schema - needs: [go_build] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/cache@v2 - continue-on-error: true - id: cache-terraform-providers-schema - timeout-minutes: 2 - with: - path: terraform-providers-schema - key: ${{ runner.os }}-terraform-providers-schema-${{ hashFiles('go.sum') }}-${{ hashFiles('internal/**') }} - - if: steps.cache-terraform-providers-schema.outputs.cache-hit != 'true' || steps.cache-terraform-providers-schema.outcome == 'failure' - uses: actions/cache@v2 - timeout-minutes: 2 - with: - path: terraform-plugin-dir - key: ${{ runner.os }}-terraform-plugin-dir-${{ hashFiles('go.sum') }}-${{ hashFiles('internal/**') }} - - if: steps.cache-terraform-providers-schema.outputs.cache-hit != 'true' || steps.cache-terraform-providers-schema.outcome == 'failure' - uses: hashicorp/setup-terraform@v1 - with: - terraform_version: ${{ env.TERRAFORM_VERSION }} - terraform_wrapper: false - - if: steps.cache-terraform-providers-schema.outputs.cache-hit != 'true' || steps.cache-terraform-providers-schema.outcome == 'failure' - name: terraform init - run: | - # We need a file to initialize the provider - echo 'data "aws_partition" "example" {}' > example.tf - terraform init -plugin-dir terraform-plugin-dir - - if: steps.cache-terraform-providers-schema.outputs.cache-hit != 'true' || steps.cache-terraform-providers-schema.outcome == 'failure' - name: terraform providers schema - run: | - mkdir terraform-providers-schema - terraform providers schema -json > terraform-providers-schema/schema.json - - providerlint: - # needs: [go_build] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - # See also: https://github.com/actions/setup-go/pull/62 - - run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV - - uses: actions/setup-go@v2 - with: - go-version: ${{ env.GO_VERSION }} - # See also: https://github.com/actions/setup-go/issues/54 - - name: go env - run: | - echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV - - uses: actions/cache@v2 - continue-on-error: true - timeout-minutes: 2 - with: - path: ${{ env.GOCACHE }} - key: ${{ runner.os }}-GOCACHE-${{ hashFiles('go.sum') }}-${{ hashFiles('aws/**') }} - - uses: actions/cache@v2 - continue-on-error: true - timeout-minutes: 2 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }} - - run: cd providerlint && go install . - - name: providerlint - run: make providerlint - - go_generate: - name: go generate - needs: [go_build] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - # See also: https://github.com/actions/setup-go/pull/62 - - run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV - - uses: actions/setup-go@v2 - with: - go-version: ${{ env.GO_VERSION }} - # See also: https://github.com/actions/setup-go/issues/54 - - name: go env - run: | - echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV - - uses: actions/cache@v2 - continue-on-error: true - timeout-minutes: 2 - with: - path: ${{ env.GOCACHE }} - key: ${{ runner.os }}-GOCACHE-${{ hashFiles('go.sum') }}-${{ hashFiles('internal/**') }} - - uses: actions/cache@v2 - continue-on-error: true - timeout-minutes: 2 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }} - - run: go install golang.org/x/tools/cmd/goimports@latest - - run: make gen - - name: Check for Git Differences - run: | - git diff --compact-summary --exit-code || \ - (echo; echo "Unexpected difference in directories after code generation. Run 'make gen' command and commit."; exit 1) - - go_test: - name: go test - needs: [go_build] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - # See also: https://github.com/actions/setup-go/pull/62 - - run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV - - uses: actions/setup-go@v2 - with: - go-version: ${{ env.GO_VERSION }} - # See also: https://github.com/actions/setup-go/issues/54 - - name: go env - run: | - echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV - - uses: actions/cache@v2 - continue-on-error: true - timeout-minutes: 2 - with: - path: ${{ env.GOCACHE }} - key: ${{ runner.os }}-GOCACHE-${{ hashFiles('go.sum') }}-${{ hashFiles('internal/**') }} - - uses: actions/cache@v2 - continue-on-error: true - timeout-minutes: 2 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }} - - name: Get all changed files - id: changed-files - uses: tj-actions/changed-files@v17.2 - - name: Get changed packages - run: | - touch /tmp/dirs_changed_all - for file in ${{ steps.changed-files.outputs.all_changed_files }}; do - if [[ "${file}" == internal/* ]]; then - echo $( dirname "${file}" | xargs ) >> /tmp/dirs_changed_all - fi - done - cat /tmp/dirs_changed_all | sort | uniq > /tmp/pkgs_changed - echo "All packages changed:" - cat /tmp/pkgs_changed - while read pkg; do - if [ "${pkg}" = "" ]; then - continue - fi - if [[ "${pkg}" == */test-fixtures ]]; then - continue - fi - if [[ "${pkg}" == internal/generate/* ]]; then - continue - fi - while read file; do - if [ "${file}" = "" ]; then - continue - fi - echo $( dirname "${file}" | xargs ) >> /tmp/dep_dirs_all - done <<< $( grep -l "github.com/hashicorp/terraform-provider-aws/${pkg}" internal/**/*.go ) - done > /tmp/dep_dirs_all - cat /tmp/dep_dirs_all | sort | uniq > /tmp/dep_pkgs - echo "All dependent packages:" - cat /tmp/dep_pkgs - id: changed-packages - - name: Run tests for changed packages - run: | - while read pkg; do - if [ "${pkg}" = "internal/sweep" ]; then - continue - fi - if [[ "${pkg}" == */test-fixtures ]]; then - continue - fi - if [[ "${pkg}" == internal/generate/* ]]; then - continue - fi - go test -run ^Test[^A][^c][^c] "github.com/hashicorp/terraform-provider-aws/${pkg}" - done > $GITHUB_ENV - - uses: actions/setup-go@v2 - with: - go-version: ${{ env.GO_VERSION }} - # See also: https://github.com/actions/setup-go/issues/54 - - name: go env - run: | - echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV - - uses: actions/cache@v2 - continue-on-error: true - timeout-minutes: 2 - with: - path: ${{ env.GOCACHE }} - key: ${{ runner.os }}-GOCACHE-${{ hashFiles('go.sum') }}-${{ hashFiles('internal/**') }} - - uses: actions/cache@v2 - continue-on-error: true - timeout-minutes: 2 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }} - - run: cd tools && go install github.com/golangci/golangci-lint/cmd/golangci-lint - - run: golangci-lint run ./internal/... - - run: cd providerlint && golangci-lint run ./... - - importlint: - needs: [go_build] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - # See also: https://github.com/actions/setup-go/pull/62 - - run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV - - uses: actions/setup-go@v2 - with: - go-version: ${{ env.GO_VERSION }} - # See also: https://github.com/actions/setup-go/issues/54 - - name: go env - run: | - echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV - - uses: actions/cache@v2 - continue-on-error: true - timeout-minutes: 2 - with: - path: ${{ env.GOCACHE }} - key: ${{ runner.os }}-GOCACHE-${{ hashFiles('go.sum') }}-${{ hashFiles('aws/**') }} - - uses: actions/cache@v2 - continue-on-error: true - timeout-minutes: 2 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }} - - run: cd tools && go install github.com/pavius/impi/cmd/impi - - run: impi --local . --scheme stdThirdPartyLocal ./... - - semgrep: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: semgrep - uses: returntocorp/semgrep-action@v1 - - tfproviderdocs: - needs: [terraform_providers_schema] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - # See also: https://github.com/actions/setup-go/pull/62 - - run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV - - uses: actions/setup-go@v2 - with: - go-version: ${{ env.GO_VERSION }} - - uses: actions/cache@v2 - continue-on-error: true - timeout-minutes: 2 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }} - - run: cd tools && go install github.com/bflad/tfproviderdocs - - uses: actions/cache@v2 - timeout-minutes: 2 - with: - path: terraform-providers-schema - key: ${{ runner.os }}-terraform-providers-schema-${{ hashFiles('go.sum') }}-${{ hashFiles('internal/**') }} - - name: tfproviderdocs check - run: | - tfproviderdocs check \ - -allowed-resource-subcategories-file website/allowed-subcategories.txt \ - -enable-contents-check \ - -ignore-file-missing-data-sources aws_alb,aws_alb_listener,aws_alb_target_group \ - -ignore-file-missing-resources aws_alb,aws_alb_listener,aws_alb_listener_certificate,aws_alb_listener_rule,aws_alb_target_group,aws_alb_target_group_attachment \ - -provider-source registry.terraform.io/hashicorp/aws \ - -providers-schema-json terraform-providers-schema/schema.json \ - -require-resource-subcategory - - compile_sweepers: - name: Compile sweepers - needs: [go_build] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - # See also: https://github.com/actions/setup-go/pull/62 - - run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV - - uses: actions/setup-go@v2 - with: - go-version: ${{ env.GO_VERSION }} - # See also: https://github.com/actions/setup-go/issues/54 - - name: go env - run: | - echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV - - uses: actions/cache@v2 - continue-on-error: true - timeout-minutes: 2 - with: - path: ${{ env.GOCACHE }} - key: ${{ runner.os }}-GOCACHE-${{ hashFiles('go.sum') }}-${{ hashFiles('internal/**') }} - - uses: actions/cache@v2 - continue-on-error: true - timeout-minutes: 2 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }} - - name: Try building - run: go build -tags=sweep diff --git a/.github/workflows.disabled/website.yml b/.github/workflows.disabled/website.yml deleted file mode 100644 index 7a713279e963..000000000000 --- a/.github/workflows.disabled/website.yml +++ /dev/null @@ -1,178 +0,0 @@ -## These checks will be superseded by documentation.yml -## when the provider documentation layout is moved to -## the Terraform Registry layout. -name: Website Checks -on: - push: - branches: - - main - - "release/**" - pull_request: - paths: - - .github/workflows/website.yml - - .go-version - - .markdownlinkcheck.json - - .markdownlint.yml - - .tflint.hcl - - website/docs/** - - tools/go.mod - -jobs: - markdown-link-check: - runs-on: ubuntu-latest - env: - UV_THREADPOOL_SIZE: 128 - steps: - - uses: actions/checkout@v3 - - uses: gaurav-nelson/github-action-markdown-link-check@v1 - name: markdown-link-check website/docs/**/*.markdown - with: - use-quiet-mode: "yes" - use-verbose-mode: "yes" - config-file: ".markdownlinkcheck.json" - folder-path: "website/docs" - file-extension: ".markdown" - base-branch: "main" - check-modified-files-only: "yes" - - uses: gaurav-nelson/github-action-markdown-link-check@v1 - name: markdown-link-check website/docs/**/*.md - with: - use-quiet-mode: "yes" - use-verbose-mode: "yes" - config-file: ".markdownlinkcheck.json" - folder-path: "website/docs" - file-extension: ".md" - base-branch: "main" - check-modified-files-only: "yes" - markdown-lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: avto-dev/markdown-lint@v1 - with: - config: ".markdownlint.yml" - args: "website/docs" - misspell: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - # See also: https://github.com/actions/setup-go/pull/62 - - run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV - - uses: actions/setup-go@v2 - with: - go-version: ${{ env.GO_VERSION }} - - uses: actions/cache@v2 - continue-on-error: true - timeout-minutes: 2 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }} - - run: cd tools && go install github.com/client9/misspell/cmd/misspell - - run: misspell -error -source text website/ - terrafmt: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - # See also: https://github.com/actions/setup-go/pull/62 - - run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV - - uses: actions/setup-go@v2 - with: - go-version: ${{ env.GO_VERSION }} - - uses: actions/cache@v2 - continue-on-error: true - timeout-minutes: 2 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }} - - run: cd tools && go install github.com/katbyte/terrafmt - - run: terrafmt diff ./website --check --pattern '*.markdown' - validate-terraform: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - # See also: https://github.com/actions/setup-go/pull/62 - - run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV - - uses: actions/setup-go@v2 - with: - go-version: ${{ env.GO_VERSION }} - - uses: actions/cache@v2 - continue-on-error: true - timeout-minutes: 2 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }} - - run: cd tools && go install github.com/katbyte/terrafmt - - - run: cd tools && go install github.com/terraform-linters/tflint - - - uses: actions/cache@v2 - name: Cache plugin dir - with: - path: ~/.tflint.d/plugins - key: ${{ matrix.os }}-tflint-${{ hashFiles('.tflint.hcl') }} - - - run: tflint --init - - - run: | - exit_code=0 - - # Configure the rules for tflint. - # The *_invalid_* rules disabled here prevent evaluation of expressions. - # Do not disable *_invalid_name rules, since these are good checks for e.g. "%s" formatting verbs - # being carried over from test cases. - shared_rules=( - "--enable-rule=terraform_comment_syntax" - "--disable-rule=aws_cloudwatch_event_target_invalid_arn" - "--disable-rule=aws_db_instance_default_parameter_group" - "--disable-rule=aws_elasticache_cluster_default_parameter_group" - "--disable-rule=aws_elasticache_replication_group_default_parameter_group" - "--disable-rule=aws_iam_policy_sid_invalid_characters" - "--disable-rule=aws_iam_saml_provider_invalid_saml_metadata_document" - "--disable-rule=aws_iam_server_certificate_invalid_certificate_body" - "--disable-rule=aws_iam_server_certificate_invalid_private_key" - "--disable-rule=aws_lb_invalid_load_balancer_type" - "--disable-rule=aws_lb_target_group_invalid_protocol" - "--disable-rule=aws_transfer_ssh_key_invalid_body" - "--disable-rule=aws_worklink_website_certificate_authority_association_invalid_certificate" - "--disable-rule=aws_iot_certificate_invalid_csr" - "--disable-rule=aws_networkfirewall_rule_group_invalid_rules" - "--disable-rule=aws_appsync_function_invalid_request_mapping_template" - "--disable-rule=aws_appsync_function_invalid_response_mapping_template" - "--disable-rule=aws_appsync_resolver_invalid_request_template" - "--disable-rule=aws_appsync_resolver_invalid_response_template" - "--disable-rule=aws_servicecatalog_portfolio_share_invalid_type" - "--disable-rule=aws_s3_object_copy_invalid_source" - ) - while read -r filename; do - rules=("${shared_rules[@]}") - if [[ "$filename" == "./website/docs/guides/version-2-upgrade.html.md" ]]; then - # ./website/docs/guides/version-2-upgrade.html.md should still include pre-0.12 syntax, - # since v1.0 does not support Terraform 0.12. - rules+=( - "--disable-rule=terraform_deprecated_interpolation" - "--disable-rule=terraform_deprecated_index" - ) - elif [[ "$filename" == "./website/docs/guides/version-3-upgrade.html.md" ]]; then - # ./website/docs/guides/version-3-upgrade.html.md has one example showing migration from - # pre-0.12 syntax to 0.12 syntax. We can't customize rules per block, and adding a - # tflint-ignore directive to documentation is not ideal. - rules+=( - "--disable-rule=terraform_deprecated_interpolation" - "--enable-rule=terraform_deprecated_index" - ) - else - rules+=( - "--enable-rule=terraform_deprecated_interpolation" - "--enable-rule=terraform_deprecated_index" - ) - fi - - # We need to capture the output and error code here. We don't want to exit on the first error - set +e - ./scripts/validate-terraform-file.sh "$filename" "${rules[@]}" - lint_exitcode=$? - set -e - if [ $lint_exitcode -ne 0 ]; then exit_code=1; fi - done < <(find ./website/docs -type f \( -name '*.md' -o -name '*.markdown' \) | sort -u) - - exit $exit_code