Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

merge #10

Merged
merged 51 commits into from
Nov 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
60046c8
refactor api gateway stage to use keyvaluetags
DrFaust92 Oct 20, 2019
75eee93
Update module yaml to v2.2.5
renovate-bot Nov 4, 2019
6ba566a
r/aws_launch_template: Tag on create.
Nov 5, 2019
300435b
Add section on handling of EC2 TagSpecifications during resource crea…
ewbankkit Nov 5, 2019
fd2ad93
Complete refactoring of r/aws_launch_template tags to use 'keyvalueta…
ewbankkit Nov 5, 2019
8cb2041
d/aws_launch_template: Refactor tags to use 'keyvaluetags'.
ewbankkit Nov 5, 2019
786fce7
r/aws_ami: Refactor tagging logic to keyvaluetags package (#10751)
DrFaust92 Nov 6, 2019
b62c8a0
r/aws_cloudwatch_log_group: Refactor tagging logic to keyvaluetags pa…
DrFaust92 Nov 6, 2019
3aad58b
Update CHANGELOG for #10753
bflad Nov 6, 2019
f90da91
r/swf_domain - add tagging support (#10763)
DrFaust92 Nov 6, 2019
b004709
Update CHANGELOG for #10763
bflad Nov 6, 2019
3245a0b
data-source/aws_cloudformation_stack: Refactor tagging logic to keyva…
DrFaust92 Nov 6, 2019
ed0e8be
Merge pull request #10759 from ewbankkit/issue-9501
bflad Nov 6, 2019
0ef6273
Update CHANGELOG for #10759
bflad Nov 6, 2019
d2163d9
r/aws_ec2_fleet: Refactor tagging logic to keyvaluetags package. (#10…
ewbankkit Nov 6, 2019
9be34f8
Update CHANGELOG for #10761
bflad Nov 6, 2019
acc7424
resource/aws_cloudformation_stack: Use keyvaluetags + enums (#10765)
DrFaust92 Nov 6, 2019
883c0be
nil checks to prevent crashes on empty config blocks (#10713)
ryndaniels Nov 6, 2019
e958510
Update CHANGELOG for #10713
bflad Nov 6, 2019
211d235
Merge branch 'master' into renovate/gopkg.in-yaml.v2-2.x
bflad Nov 6, 2019
62d8e29
deps: Add missing checksum from gopkg.in/yaml.v2@v2.2.5 update
bflad Nov 6, 2019
736654e
Merge branch 'renovate/gopkg.in-yaml.v2-2.x'
bflad Nov 6, 2019
b645187
provider: Add docscheck make target/script
justincampbell Oct 30, 2019
ff208fb
website: Require explicit empty subcategory
justincampbell Oct 30, 2019
c042adc
website: Add KMS subcategory for kms_secret
justincampbell Oct 30, 2019
446c5d9
website: Require page_title for guides
justincampbell Nov 1, 2019
6050201
website: Add subcategory to resources/data sources
justincampbell Nov 6, 2019
bfbe848
Merge pull request #10684 from terraform-providers/terraform-registry…
justincampbell Nov 6, 2019
6720d59
aws_ebs_volume: Refactor tagging logic to keyvaluetags package. (#10778)
ewbankkit Nov 7, 2019
fb404a8
r/aws_ec2_capacity_reservation: Refactor tagging logic to keyvaluetag…
ewbankkit Nov 7, 2019
571f1b4
v2.35.0
Nov 7, 2019
4c9bddb
Cleanup after v2.35.0 release
Nov 7, 2019
39e2234
resource/aws_sqs_queue: Refactor to use keyvaluetags package and SDK …
DrFaust92 Nov 8, 2019
5a24582
resource/aws_sqs_queue: Re-add contextual comment about ignoring cert…
bflad Nov 8, 2019
c0ee1bb
Refactor API Gateway Stage Resource - use keyvaluetags + enums (#10570)
bflad Nov 8, 2019
c5d2e23
docs/resource/aws_api_gateway_stage: Fix arn attribute indentation an…
bflad Nov 8, 2019
d8ad253
Update CHANGELOG for #10570
bflad Nov 8, 2019
d26c499
Adjust CHANGELOG for #10570
bflad Nov 8, 2019
50d66de
Add Tag Support to API Gateway Usage Plan Resource (#10566)
DrFaust92 Nov 8, 2019
7ca2e38
Update CHANGELOG for #10566
bflad Nov 8, 2019
1813f5f
resource/aws_cloudformation_stack_set: Refactor to use keyvaluetags p…
DrFaust92 Nov 8, 2019
296ca65
resource/aws_waf_rule: Add arn attribute and refactor to use keyvalue…
DrFaust92 Nov 8, 2019
9176e86
Update CHANGELOG for #10798
bflad Nov 8, 2019
ff2cb21
resource/aws_waf_rule_group: Add arn attribute and refactor to use ke…
DrFaust92 Nov 8, 2019
82d72a5
Update CHANGELOG for #10799
bflad Nov 8, 2019
2b61253
data-source/aws_iam_group: Add users attribute (#7132)
teraken0509 Nov 8, 2019
a9e95f9
Update CHANGELOG for #7132
bflad Nov 8, 2019
3bfa838
resource/aws_waf_web_acl: Refactor to use keyvaluetags.WafListTags() …
DrFaust92 Nov 8, 2019
8681bbd
Update module aws/aws-sdk-go to v1.25.30 (#10717)
renovate[bot] Nov 8, 2019
cd4c102
Update module aws/aws-sdk-go to v1.25.31 (#10808)
renovate[bot] Nov 8, 2019
4eae2a0
Add PR triage label behavior
aeschright Nov 8, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 9 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,15 @@ More details about this code generation, including fixes for potential error mes
}
```

- Some EC2 resources (for example [`aws_ec2_fleet`](https://www.terraform.io/docs/providers/aws/r/ec2_fleet.html)) have a `TagsSpecification` field in the `InputStruct` instead of a `Tags` field. In these cases the `ec2TagSpecificationsFromMap()` helper function should be used, e.g.:

```go
input := &ec2.CreateFleetInput{
/* ... other configuration ... */
TagSpecifications: ec2TagSpecificationsFromMap(d.Get("tags").(map[string]interface{}), ec2.ResourceTypeFleet),
}
```

- In the resource `Read` function, implement the logic to convert the service tags to save them into the Terraform state for drift detection, e.g. with EKS Clusters (which had the tags available in the DescribeCluster API call):

```go
Expand Down
4 changes: 4 additions & 0 deletions .hashibot.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ behavior "deprecated_import_commenter" "hashicorp_terraform" {
EOF
}

behavior "opened_pull_request_labeler" "triage" {
labels = ["needs-triage"]
}

queued_behavior "release_commenter" "releases" {
repo_prefix = "terraform-provider-"

Expand Down
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ matrix:
- go: "1.13.x"
name: "Website"
script:
- make docscheck
- make website-test
- make website-lint

Expand Down
65 changes: 40 additions & 25 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,55 @@
## 2.35.0 (Unreleased)
## 2.36.0 (Unreleased)

ENHANCEMENTS:

* data-source/aws_iam_group: Add `users` attribute [GH-7132]
* resource/aws_apigateway_stage: Add `arn` attribute [GH-10570]
* resource/aws_apigateway_usage_plan: Add `tags` argument and `arn` attribute [GH-10566]
* resource/aws_waf_rule: Add `arn` attribute [GH-10798]
* resource/aws_waf_rule_group: Add `arn` attribute [GH-10799]

## 2.35.0 (November 07, 2019)

NOTES:

* provider: New `ignore_tag_prefixes` and `ignore_tags` arguments are being tested as a public preview for ignoring tags across all resources under a provider. Support for the functionality must be added to individual resources in the codebase and is only implemented for the `aws_subnet` and `aws_vpc` resources at this time. Until a general availability announcement, no compatibility promises are made with these provider arguments and their functionality. [GH-10418]
* provider: New `ignore_tag_prefixes` and `ignore_tags` arguments are being tested as a public preview for ignoring tags across all resources under a provider. Support for the functionality must be added to individual resources in the codebase and is only implemented for the `aws_subnet` and `aws_vpc` resources at this time. Until a general availability announcement, no compatibility promises are made with these provider arguments and their functionality. ([#10418](https://github.com/terraform-providers/terraform-provider-aws/issues/10418))

FEATURES:

* **New Data Source:** `aws_qldb_ledger` [GH-10394]
* **New Resource:** `aws_qldb_ledger` [GH-10394]
* **New Data Source:** `aws_qldb_ledger` ([#10394](https://github.com/terraform-providers/terraform-provider-aws/issues/10394))
* **New Resource:** `aws_qldb_ledger` ([#10394](https://github.com/terraform-providers/terraform-provider-aws/issues/10394))

ENHANCEMENTS:

* data-source/aws_db_cluster_snapshot: Add `tags` attribute [GH-10488]
* data-source/aws_db_instance: Add `tags` attribute [GH-10550]
* data-source/aws_vpc_endpoint: Add `filter` and `tags` arguments [GH-10503]
* provider: Add `ignore_tag_prefixes` and `ignore_tags` arguments (in public preview, see note above) [GH-10418]
* resource/aws_acmpca_certificate_authority: Support tagging on creation [GH-10736]
* resource/aws_api_gateway_api_key: Add `tags` argument and `arn` attribute [GH-10568]
* resource/aws_api_gateway_client_certificate: Add `tags` argument and `arn` attribute [GH-10569]
* resource/aws_api_gateway_domain_name: Add `tags` argument and `arn` attribute [GH-10567]
* resource/aws_api_gateway_vpc_link: Add `tags` argument and `arn` attribute [GH-10561]
* resource/aws_db_cluster_snapshot: Add `tags` argument [GH-10488]
* resource/aws_mq_broker: Support in-place `security_groups` updates [GH-10442]
* resource/aws_storagegateway_cached_iscsi_volume: Add `tags` argument [GH-10613]
* resource/aws_storagegateway_gateway: Add `tags` argument [GH-10588]
* resource/aws_storagegateway_nfs_file_share: Add `tags` argument [GH-10722]
* resource/aws_subnet: Support provider-wide ignore tags (in public preview, see note above) [GH-10418]
* resource/aws_vpc: Support provider-wide ignore tags (in public preview, see note above) [GH-10418]
* resource/aws_waf_rate_based_rule: Add `tags` argument and `arn` attribute [GH-10479]
* data-source/aws_db_cluster_snapshot: Add `tags` attribute ([#10488](https://github.com/terraform-providers/terraform-provider-aws/issues/10488))
* data-source/aws_db_instance: Add `tags` attribute ([#10550](https://github.com/terraform-providers/terraform-provider-aws/issues/10550))
* data-source/aws_vpc_endpoint: Add `filter` and `tags` arguments ([#10503](https://github.com/terraform-providers/terraform-provider-aws/issues/10503))
* provider: Add `ignore_tag_prefixes` and `ignore_tags` arguments (in public preview, see note above) ([#10418](https://github.com/terraform-providers/terraform-provider-aws/issues/10418))
* resource/aws_acmpca_certificate_authority: Support tagging on creation ([#10736](https://github.com/terraform-providers/terraform-provider-aws/issues/10736))
* resource/aws_api_gateway_api_key: Add `tags` argument and `arn` attribute ([#10568](https://github.com/terraform-providers/terraform-provider-aws/issues/10568))
* resource/aws_api_gateway_client_certificate: Add `tags` argument and `arn` attribute ([#10569](https://github.com/terraform-providers/terraform-provider-aws/issues/10569))
* resource/aws_api_gateway_domain_name: Add `tags` argument and `arn` attribute ([#10567](https://github.com/terraform-providers/terraform-provider-aws/issues/10567))
* resource/aws_api_gateway_vpc_link: Add `tags` argument and `arn` attribute ([#10561](https://github.com/terraform-providers/terraform-provider-aws/issues/10561))
* resource/aws_cloudwatch_log_group: Support tagging on creation ([#10753](https://github.com/terraform-providers/terraform-provider-aws/issues/10753))
* resource/aws_db_cluster_snapshot: Add `tags` argument ([#10488](https://github.com/terraform-providers/terraform-provider-aws/issues/10488))
* resource/aws_ec2_fleet: Support in-place `tags` updates ([#10761](https://github.com/terraform-providers/terraform-provider-aws/issues/10761))
* resource/aws_launch_template: Support tagging on creation ([#10759](https://github.com/terraform-providers/terraform-provider-aws/issues/10759))
* resource/aws_mq_broker: Support in-place `security_groups` updates ([#10442](https://github.com/terraform-providers/terraform-provider-aws/issues/10442))
* resource/aws_storagegateway_cached_iscsi_volume: Add `tags` argument ([#10613](https://github.com/terraform-providers/terraform-provider-aws/issues/10613))
* resource/aws_storagegateway_gateway: Add `tags` argument ([#10588](https://github.com/terraform-providers/terraform-provider-aws/issues/10588))
* resource/aws_storagegateway_nfs_file_share: Add `tags` argument ([#10722](https://github.com/terraform-providers/terraform-provider-aws/issues/10722))
* resource/aws_subnet: Support provider-wide ignore tags (in public preview, see note above) ([#10418](https://github.com/terraform-providers/terraform-provider-aws/issues/10418))
* resource/aws_swf_domain: Add `tags` argument and `arn` attribute ([#10763](https://github.com/terraform-providers/terraform-provider-aws/issues/10763))
* resource/aws_vpc: Support provider-wide ignore tags (in public preview, see note above) ([#10418](https://github.com/terraform-providers/terraform-provider-aws/issues/10418))
* resource/aws_waf_rate_based_rule: Add `tags` argument and `arn` attribute ([#10479](https://github.com/terraform-providers/terraform-provider-aws/issues/10479))

BUG FIXES:

* data-source/aws_route53_resolver_rule: Do not retrieve tags for rules shared with the AWS account that owns the data source [GH-10348]
* resource/aws_api_gateway_authorizer: Set `authorizer_result_ttl_in_seconds` argument default to 300 to match API default which properly allows setting to 0 for disabling caching [GH-9605]
* resource/aws_autoscaling_group: Batch ELB attachments and detachments by 10 to prevent API and rate limiting errors [GH-10445]
* resource/aws_s3_bucket_public_access_block: Remove from Terraform state when S3 Bucket is already destroyed [GH-10534]
* data-source/aws_route53_resolver_rule: Do not retrieve tags for rules shared with the AWS account that owns the data source ([#10348](https://github.com/terraform-providers/terraform-provider-aws/issues/10348))
* resource/aws_api_gateway_authorizer: Set `authorizer_result_ttl_in_seconds` argument default to 300 to match API default which properly allows setting to 0 for disabling caching ([#9605](https://github.com/terraform-providers/terraform-provider-aws/issues/9605))
* resource/aws_autoscaling_group: Batch ELB attachments and detachments by 10 to prevent API and rate limiting errors ([#10445](https://github.com/terraform-providers/terraform-provider-aws/issues/10445))
* resource/aws_s3_bucket_public_access_block: Remove from Terraform state when S3 Bucket is already destroyed ([#10534](https://github.com/terraform-providers/terraform-provider-aws/issues/10534))
* resource/aws_ssm_maintenance_window_task: Prevent crashes with empty configuration blocks ([#10713](https://github.com/terraform-providers/terraform-provider-aws/issues/10713))

## 2.34.0 (October 31, 2019)

Expand Down
5 changes: 4 additions & 1 deletion GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ fmtcheck:
websitefmtcheck:
@sh -c "'$(CURDIR)/scripts/websitefmtcheck.sh'"

docscheck:
@sh -c "'$(CURDIR)/scripts/docscheck.sh'"

lint:
@echo "==> Checking source code against linters..."
@golangci-lint run ./$(PKG_NAME)/...
Expand Down Expand Up @@ -91,5 +94,5 @@ ifeq (,$(wildcard $(GOPATH)/src/$(WEBSITE_REPO)))
endif
@$(MAKE) -C $(GOPATH)/src/$(WEBSITE_REPO) website-provider-test PROVIDER_PATH=$(shell pwd) PROVIDER_NAME=$(PKG_NAME)

.PHONY: build gen sweep test testacc fmt fmtcheck lint tools test-compile website website-lint website-test
.PHONY: build gen sweep test testacc fmt fmtcheck lint tools test-compile website website-lint website-test docscheck

10 changes: 5 additions & 5 deletions aws/data_source_aws_cloudformation_stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/cloudformation"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags"
)

func dataSourceAwsCloudFormationStack() *schema.Resource {
Expand Down Expand Up @@ -62,10 +63,7 @@ func dataSourceAwsCloudFormationStack() *schema.Resource {
Type: schema.TypeString,
Computed: true,
},
"tags": {
Type: schema.TypeMap,
Computed: true,
},
"tags": tagsSchemaComputed(),
},
}
}
Expand Down Expand Up @@ -98,7 +96,9 @@ func dataSourceAwsCloudFormationStackRead(d *schema.ResourceData, meta interface
}

d.Set("parameters", flattenAllCloudFormationParameters(stack.Parameters))
d.Set("tags", flattenCloudFormationTags(stack.Tags))
if err := d.Set("tags", keyvaluetags.CloudformationKeyValueTags(stack.Tags).IgnoreAws().Map()); err != nil {
return fmt.Errorf("error setting tags: %s", err)
}
d.Set("outputs", flattenCloudFormationOutputs(stack.Outputs))

if len(stack.Capabilities) > 0 {
Expand Down
54 changes: 26 additions & 28 deletions aws/data_source_aws_cloudformation_stack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
)

func TestAccAWSCloudFormationStack_dataSource_basic(t *testing.T) {
rString := acctest.RandString(8)
stackName := fmt.Sprintf("tf-acc-ds-basic-%s", rString)
stackName := acctest.RandomWithPrefix("tf-acc-ds-basic")
resourceName := "data.aws_cloudformation_stack.network"

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Expand All @@ -20,18 +20,17 @@ func TestAccAWSCloudFormationStack_dataSource_basic(t *testing.T) {
{
Config: testAccCheckAwsCloudFormationStackDataSourceConfig_basic(stackName),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("data.aws_cloudformation_stack.network", "outputs.%", "1"),
resource.TestMatchResourceAttr("data.aws_cloudformation_stack.network", "outputs.VPCId",
regexp.MustCompile("^vpc-[a-z0-9]+")),
resource.TestCheckResourceAttr("data.aws_cloudformation_stack.network", "capabilities.#", "0"),
resource.TestCheckResourceAttr("data.aws_cloudformation_stack.network", "disable_rollback", "false"),
resource.TestCheckResourceAttr("data.aws_cloudformation_stack.network", "notification_arns.#", "0"),
resource.TestCheckResourceAttr("data.aws_cloudformation_stack.network", "parameters.%", "1"),
resource.TestCheckResourceAttr("data.aws_cloudformation_stack.network", "parameters.CIDR", "10.10.10.0/24"),
resource.TestCheckResourceAttr("data.aws_cloudformation_stack.network", "timeout_in_minutes", "6"),
resource.TestCheckResourceAttr("data.aws_cloudformation_stack.network", "tags.%", "2"),
resource.TestCheckResourceAttr("data.aws_cloudformation_stack.network", "tags.Name", "Form the Cloud"),
resource.TestCheckResourceAttr("data.aws_cloudformation_stack.network", "tags.Second", "meh"),
resource.TestCheckResourceAttr(resourceName, "outputs.%", "1"),
resource.TestMatchResourceAttr(resourceName, "outputs.VPCId", regexp.MustCompile("^vpc-[a-z0-9]+")),
resource.TestCheckResourceAttr(resourceName, "capabilities.#", "0"),
resource.TestCheckResourceAttr(resourceName, "disable_rollback", "false"),
resource.TestCheckResourceAttr(resourceName, "notification_arns.#", "0"),
resource.TestCheckResourceAttr(resourceName, "parameters.%", "1"),
resource.TestCheckResourceAttr(resourceName, "parameters.CIDR", "10.10.10.0/24"),
resource.TestCheckResourceAttr(resourceName, "timeout_in_minutes", "6"),
resource.TestCheckResourceAttr(resourceName, "tags.%", "2"),
resource.TestCheckResourceAttr(resourceName, "tags.Name", "Form the Cloud"),
resource.TestCheckResourceAttr(resourceName, "tags.Second", "meh"),
),
},
},
Expand Down Expand Up @@ -89,8 +88,8 @@ data "aws_cloudformation_stack" "network" {
}

func TestAccAWSCloudFormationStack_dataSource_yaml(t *testing.T) {
rString := acctest.RandString(8)
stackName := fmt.Sprintf("tf-acc-ds-yaml-%s", rString)
stackName := acctest.RandomWithPrefix("tf-acc-ds-yaml")
resourceName := "data.aws_cloudformation_stack.yaml"

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Expand All @@ -99,18 +98,17 @@ func TestAccAWSCloudFormationStack_dataSource_yaml(t *testing.T) {
{
Config: testAccCheckAwsCloudFormationStackDataSourceConfig_yaml(stackName),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("data.aws_cloudformation_stack.yaml", "outputs.%", "1"),
resource.TestMatchResourceAttr("data.aws_cloudformation_stack.yaml", "outputs.VPCId",
regexp.MustCompile("^vpc-[a-z0-9]+")),
resource.TestCheckResourceAttr("data.aws_cloudformation_stack.yaml", "capabilities.#", "0"),
resource.TestCheckResourceAttr("data.aws_cloudformation_stack.yaml", "disable_rollback", "false"),
resource.TestCheckResourceAttr("data.aws_cloudformation_stack.yaml", "notification_arns.#", "0"),
resource.TestCheckResourceAttr("data.aws_cloudformation_stack.yaml", "parameters.%", "1"),
resource.TestCheckResourceAttr("data.aws_cloudformation_stack.yaml", "parameters.CIDR", "10.10.10.0/24"),
resource.TestCheckResourceAttr("data.aws_cloudformation_stack.yaml", "timeout_in_minutes", "6"),
resource.TestCheckResourceAttr("data.aws_cloudformation_stack.yaml", "tags.%", "2"),
resource.TestCheckResourceAttr("data.aws_cloudformation_stack.yaml", "tags.Name", "Form the Cloud"),
resource.TestCheckResourceAttr("data.aws_cloudformation_stack.yaml", "tags.Second", "meh"),
resource.TestCheckResourceAttr(resourceName, "outputs.%", "1"),
resource.TestMatchResourceAttr(resourceName, "outputs.VPCId", regexp.MustCompile("^vpc-[a-z0-9]+")),
resource.TestCheckResourceAttr(resourceName, "capabilities.#", "0"),
resource.TestCheckResourceAttr(resourceName, "disable_rollback", "false"),
resource.TestCheckResourceAttr(resourceName, "notification_arns.#", "0"),
resource.TestCheckResourceAttr(resourceName, "parameters.%", "1"),
resource.TestCheckResourceAttr(resourceName, "parameters.CIDR", "10.10.10.0/24"),
resource.TestCheckResourceAttr(resourceName, "timeout_in_minutes", "6"),
resource.TestCheckResourceAttr(resourceName, "tags.%", "2"),
resource.TestCheckResourceAttr(resourceName, "tags.Name", "Form the Cloud"),
resource.TestCheckResourceAttr(resourceName, "tags.Second", "meh"),
),
},
},
Expand Down
8 changes: 6 additions & 2 deletions aws/data_source_aws_ebs_volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/aws/aws-sdk-go/aws/arn"
"github.com/aws/aws-sdk-go/service/ec2"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags"
)

func dataSourceAwsEbsVolume() *schema.Resource {
Expand Down Expand Up @@ -141,6 +142,9 @@ func volumeDescriptionAttributes(d *schema.ResourceData, client *AWSClient, volu
d.Set("snapshot_id", volume.SnapshotId)
d.Set("volume_type", volume.VolumeType)

err := d.Set("tags", tagsToMap(volume.Tags))
return err
if err := d.Set("tags", keyvaluetags.Ec2KeyValueTags(volume.Tags).IgnoreAws().Map()); err != nil {
return fmt.Errorf("error setting tags: %s", err)
}

return nil
}
40 changes: 40 additions & 0 deletions aws/data_source_aws_iam_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,30 @@ func dataSourceAwsIAMGroup() *schema.Resource {
Type: schema.TypeString,
Required: true,
},
"users": {
Type: schema.TypeList,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"arn": {
Type: schema.TypeString,
Computed: true,
},
"user_id": {
Type: schema.TypeString,
Computed: true,
},
"user_name": {
Type: schema.TypeString,
Computed: true,
},
"path": {
Type: schema.TypeString,
Computed: true,
},
},
},
},
},
}
}
Expand Down Expand Up @@ -58,6 +82,22 @@ func dataSourceAwsIAMGroupRead(d *schema.ResourceData, meta interface{}) error {
d.Set("arn", group.Arn)
d.Set("path", group.Path)
d.Set("group_id", group.GroupId)
if err := d.Set("users", dataSourceUsersRead(resp.Users)); err != nil {
return fmt.Errorf("error setting users: %s", err)
}

return nil
}

func dataSourceUsersRead(iamUsers []*iam.User) []map[string]interface{} {
users := make([]map[string]interface{}, 0, len(iamUsers))
for _, i := range iamUsers {
u := make(map[string]interface{})
u["arn"] = aws.StringValue(i.Arn)
u["user_id"] = aws.StringValue(i.UserId)
u["user_name"] = aws.StringValue(i.UserName)
u["path"] = aws.StringValue(i.Path)
users = append(users, u)
}
return users
}
Loading