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

Rename s3_bucket_object to s3_object #22824

Closed
wants to merge 122 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
eb16c3f
Fix data source aws_vpc_peering_connections
Feb 1, 2021
2d16fb1
Prevent potential panics
borancar Feb 11, 2021
a0ab372
Re-add fmt
borancar Feb 11, 2021
a036f55
r/route and r/route_table: deprecate 'instance_id'
anGie44 Jan 19, 2022
fa0c0bf
Update CHANGELOG for #22664
anGie44 Jan 19, 2022
147eb80
Update CHANGELOG.md
anGie44 Jan 19, 2022
7745902
add acceptance test coverage
anGie44 Jan 20, 2022
9fe7eb2
Add resource aws_s3_bucket_versioning
devonbleak Jul 9, 2018
37578bc
CR updates: align with API and update overall provider design patterns
anGie44 Jan 21, 2022
635b943
Update CHANGELOG for #5132
anGie44 Jan 21, 2022
52bcce0
first draft
dirk39 Dec 14, 2021
f0986d2
ok
dirk39 Dec 14, 2021
2f9abdf
test ok. manage destroy
dirk39 Dec 15, 2021
5cb7f70
test ok. destroy ok
dirk39 Dec 15, 2021
9278bd7
test ok. destroy ok
dirk39 Dec 15, 2021
24a12af
updated doc
dirk39 Dec 16, 2021
ffc7032
Revert "updated doc"
ewbankkit Jan 18, 2022
c0c383d
Revert "test ok. destroy ok"
ewbankkit Jan 18, 2022
1b9b40e
Revert "test ok. destroy ok"
ewbankkit Jan 18, 2022
6e71780
Revert "test ok. manage destroy"
ewbankkit Jan 18, 2022
d697182
Revert "ok"
ewbankkit Jan 18, 2022
a83fbd2
Revert "first draft"
ewbankkit Jan 18, 2022
80d927b
r/aws_default_subnet: Full resource life cycle. First baby steps.
ewbankkit Jan 11, 2022
2bbee06
r/aws_default_subnet: Full resource life cycle. Playing with some ide…
ewbankkit Jan 11, 2022
579817c
r/aws_default_subnet: 'map_public_ip_on_launch' has a Default of true.
ewbankkit Jan 12, 2022
6891304
Additional 'modifySubnetAttriute' functions.
ewbankkit Jan 12, 2022
6133dee
r/aws_default_subnet: Complete 'modifySubnetAttributesOnCreate'.
ewbankkit Jan 12, 2022
0c6b361
r/aws_default_subnet: Set tags on resource Create.
ewbankkit Jan 13, 2022
b8ce12f
r/aws_default_subnet: Corrections after some testing.
ewbankkit Jan 13, 2022
c745b41
'setting' -> 'modifying' in error messages.
ewbankkit Jan 14, 2022
9f3793d
r/aws_default_vpc: Don't reuse ResourceVPC's schema.
ewbankkit Jan 19, 2022
ed3a883
Tidy up subnet and VPC sweepers.
ewbankkit Jan 19, 2022
44da933
r/aws_default_vpc: IPv6 changes.
ewbankkit Jan 19, 2022
19ba7f1
r/aws_default_vpc: Test IPv6 changes.
ewbankkit Jan 19, 2022
0906d91
r/aws_default_vpc and r/aws_default_subnet: Serialize tests.
ewbankkit Jan 19, 2022
a4eefca
Store any new IPv6 CIDR block association ID to state.
ewbankkit Jan 19, 2022
f256420
Add 'testAccPreCheckDefaultVPCAvailable'.
ewbankkit Jan 20, 2022
791060e
Add 'testAccPreCheckDefaultSubnetAvailable'.
ewbankkit Jan 20, 2022
d5981f8
r/aws_default_vpc and r/aws_default_subnet: Check existence in TestCa…
ewbankkit Jan 20, 2022
df42c93
Add CHANGELOG entry.
ewbankkit Jan 20, 2022
3623ce0
d/aws_vpcs: Return empty list when no VPCs match.
ewbankkit Jan 20, 2022
33a5406
EC2: 'testCheckResourceAttrGreaterThanValue' -> 'acctest.CheckResourc…
ewbankkit Jan 20, 2022
f1037c4
EKS: 'testCheckResourceAttrGreaterThanValue' -> 'acctest.CheckResourc…
ewbankkit Jan 20, 2022
37d394d
r/aws_default_subnet: Add 'testAccEC2DefaultSubnet_privateDnsNameOpti…
ewbankkit Jan 20, 2022
bc326ba
r/aws_default_vpc: Add `force_destroy` and create new tests.
ewbankkit Jan 20, 2022
8f5a196
r/aws_default_subnet: Additional tests.
ewbankkit Jan 20, 2022
3179b6c
r/aws_default_subnet: Ensure default subnets are recreated.
ewbankkit Jan 21, 2022
ff91cc4
r/aws_default_subnet & r/aws_default_vpc: Don't run acceptance tests …
ewbankkit Jan 21, 2022
da0ba1c
Documentation updates.
ewbankkit Jan 21, 2022
e1b4451
aws_vpn_connection resource's customer_gateway_configuration should b…
b-dean Oct 22, 2020
471c00b
Add CHANGELOG entry.
ewbankkit Jan 24, 2022
7bdea4a
Added data source 'aws_eips'. (#7537)
Dchamard Jan 25, 2022
4a3f8ef
Add default values to aws_vpn_connection (#17031)
shoekstra Jan 26, 2022
fba5caf
removed field instance_interruption_behaviour from spot_instance_request
dirk39 Nov 13, 2021
99521dc
removed unused function
dirk39 Nov 14, 2021
625cb10
remove :* suffix
maquessime Dec 3, 2021
3965f73
add missing import and update data source tests
anGie44 Jan 26, 2022
f2c0e86
Update CHANGELOG for #22043
anGie44 Jan 26, 2022
d9a431e
Return empty list when aws_security_groups doesnt match any SG
jordiprats Oct 20, 2021
3f05572
Add option to allow no results when querying for instances data
Jul 2, 2018
01be797
Revert "Add option to allow no results when querying for instances data"
ewbankkit Jan 25, 2022
8d8365f
d/aws_security_groups: Alphabetize attributes.
ewbankkit Jan 25, 2022
03d5419
d/aws_security_groups: Use `FindSecurityGroups`.
ewbankkit Jan 25, 2022
8559bd4
Add CHANGELOG entry.
ewbankkit Jan 25, 2022
4b2af87
Add and use 'FindInstances'.
ewbankkit Jan 25, 2022
bbaf8f5
d/aws_instances: Use 'FindInstances'.
ewbankkit Jan 25, 2022
4e5cc09
d/aws_route_tables: Call 'FindRouteTables'.
ewbankkit Jan 25, 2022
34cf3f2
d/aws_network_interfaces: Allow empty results.
ewbankkit Jan 25, 2022
9a1f482
d/aws_network_acls: Use 'FindNetworkACLs'.
ewbankkit Jan 25, 2022
2fb5c05
d/aws_ec2_transit_gateway_route_tables: Add and use 'FindTransitGatew…
ewbankkit Jan 25, 2022
b36fc76
d/aws_coip_pools: Add and use 'FindCOIPPools'.
ewbankkit Jan 25, 2022
506759c
d/aws_ec2_local_gateway_route_tables: Add and use 'FindLocalGatewayRo…
ewbankkit Jan 25, 2022
1552b2e
d/aws_ec2_local_gateway_virtual_interface_groups: Add and use 'FindLo…
ewbankkit Jan 26, 2022
520e2ec
d/aws_ec2_local_gateways: Add and use 'FindLocalGateways'.
ewbankkit Jan 26, 2022
997dc13
d/aws_ebs_volumes: Add and use 'FindEBSVolumes'.
ewbankkit Jan 26, 2022
7e586e9
'CustomFiltersSchema' -> 'DataSourceFiltersSchema'.
ewbankkit Jan 26, 2022
dd408bc
d/aws_cognito_user_pools: Allow no pools to be selected.
ewbankkit Jan 26, 2022
2c0ee5e
d/aws_ip_ranges: Allow empty results.
ewbankkit Jan 26, 2022
d443916
d/aws_efs_access_points: Allow empty results.
ewbankkit Jan 26, 2022
255bc9a
d/aws_emr_release_labels: Allow empty result.
ewbankkit Jan 26, 2022
466f15b
d/aws_ssoadmin_instances: Allow empty results.
ewbankkit Jan 26, 2022
41f9c0d
d/aws_instances: Correct argument name.
ewbankkit Jan 26, 2022
82f6985
Add aws_s3_bucket_cors_configuration resource (#12141)
drexler Jan 27, 2022
2b54712
r/aws_ecs_cluster: deprecate the capacity_providers & default_capacit…
roberth-k Jan 26, 2022
98ff667
add changelog entry for #22783
roberth-k Jan 26, 2022
3468d16
gofmt after rebase
anGie44 Jan 28, 2022
3f17bf3
Add option to allow no results when querying for instances data
Jul 2, 2018
a9fa420
Revert "Add option to allow no results when querying for instances data"
ewbankkit Jan 25, 2022
ed4be8b
Rename to
YakDriver Jan 28, 2022
b1ebba4
synthetics: Rename s3_bucket_object
YakDriver Jan 28, 2022
c632112
ssm: Rename s3_bucket_object
YakDriver Jan 28, 2022
004d20b
signer: Rename s3_bucket_object
YakDriver Jan 28, 2022
c8bcd1e
servicecatalog: Rename s3_bucket_object
YakDriver Jan 28, 2022
dc52142
sagemaker: Rename s3_bucket_object
YakDriver Jan 28, 2022
eaaa14f
s3: Rename s3_bucket_object files
YakDriver Jan 28, 2022
0809fb2
rds: Rename s3_bucket_object
YakDriver Jan 28, 2022
d17f436
quicksight: Rename s3_bucket_object
YakDriver Jan 28, 2022
8925e54
mwaa: Rename s3_bucket_object
YakDriver Jan 28, 2022
aba12ef
Update semgrep
YakDriver Jan 28, 2022
c8bb8ec
Update examples
YakDriver Jan 28, 2022
d38680b
provider: Rename s3_bucket_object
YakDriver Jan 28, 2022
e8e6745
lambda: Rename s3_bucket_object
YakDriver Jan 28, 2022
df13710
kinesis: Rename s3_bucket_object
YakDriver Jan 28, 2022
1c36458
kafkaconnect: Rename s3_bucket_object
YakDriver Jan 28, 2022
204c618
imagebuilder: Rename s3_bucket_object
YakDriver Jan 28, 2022
36ca31b
guardduty: Rename s3_bucket_object
YakDriver Jan 28, 2022
d6cb03c
emr: Rename s3_bucket_object
YakDriver Jan 28, 2022
40ba431
elasticbeanstalk: Rename s3_bucket_object
YakDriver Jan 28, 2022
2317b57
ec2: Rename s3_bucket_object
YakDriver Jan 28, 2022
0461b1e
configservice: Rename s3_bucket_object
YakDriver Jan 28, 2022
c36cf5c
codebuild: Rename s3_bucket_object
YakDriver Jan 28, 2022
1b09f3b
cloudformation: Rename s3_bucket_object
YakDriver Jan 28, 2022
7ddaaf4
apigateway: Rename s3_bucket_object
YakDriver Jan 28, 2022
93e3ceb
apigatewayv2: Rename s3_bucket_object
YakDriver Jan 28, 2022
ead0820
provider: Rename s3_bucket_object
YakDriver Jan 28, 2022
5380686
apigateway: Rename s3_bucket_object
YakDriver Jan 28, 2022
16d5944
apigatewayv2: Rename s3_bucket_object
YakDriver Jan 28, 2022
efb730b
ec2: Rename s3_bucket_object
YakDriver Jan 28, 2022
185b6a1
kinesis: Rename s3_bucket_object
YakDriver Jan 28, 2022
fd35411
mwaa: Rename s3_bucket_object
YakDriver Jan 28, 2022
a6c22a5
s3: Rename s3_bucket_object
YakDriver Jan 28, 2022
2a80ba7
Add changelog
YakDriver Jan 28, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/12141.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:new-resource
aws_s3_bucket_cors_configuration
```
3 changes: 3 additions & 0 deletions .changelog/15806.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/aws_vpn_connection: Mark `customer_gateway_configuration` as [`Sensitive`](https://www.terraform.io/plugin/sdkv2/best-practices/sensitive-state#using-the-sensitive-flag)
```
3 changes: 3 additions & 0 deletions .changelog/17031.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/aws_vpn_connection: Add the ability to revert changes to unconfigured tunnel options made outside of Terraform to their (documented default values)[(https://docs.aws.amazon.com/vpn/latest/s2svpn/VPNTunnels.html)]
```
3 changes: 3 additions & 0 deletions .changelog/17382.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
data-source/aws_vpc_peering_connections: Return empty array instead of error when no connections found.
```
67 changes: 67 additions & 0 deletions .changelog/21219.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
```release-note:note
data-source/aws_security_groups: If no security groups match the specified criteria an empty list is returned (previously an error was raised)
```

```release-note:note
data-source/aws_route_tables: The type of the `ids` attribute has changed from Set to List. If no route tables match the specified criteria an empty list is returned (previously an error was raised)
```

```release-note:note
data-source/aws_network_interfaces: The type of the `ids` attribute has changed from Set to List. If no network interfaces match the specified criteria an empty list is returned (previously an error was raised)
```

```release-note:note
data-source/aws_network_acls: The type of the `ids` attribute has changed from Set to List. If no NACLs match the specified criteria an empty list is returned (previously an error was raised)
```

```release-note:note
data-source/aws_ec2_transit_gateway_route_tables: The type of the `ids` attribute has changed from Set to List. If no transit gateway route tables match the specified criteria an empty list is returned (previously an error was raised)
```

```release-note:note
data-source/aws_ec2_coip_pools: The type of the `pool_ids` attribute has changed from Set to List. If no COIP pools match the specified criteria an empty list is returned (previously an error was raised)
```

```release-note:note
data-source/aws_ec2_local_gateway_route_tables: The type of the `ids` attribute has changed from Set to List. If no local gateway route tables match the specified criteria an empty list is returned (previously an error was raised)
```

```release-note:note
data-source/aws_ec2_local_gateway_virtual_interface_groups: The type of the `ids` and `local_gateway_virtual_interface_ids` attributes has changed from Set to List. If no local gateway virtual interface groups match the specified criteria an empty list is returned (previously an error was raised)
```

```release-note:note
data-source/aws_ec2_local_gateways: The type of the `ids` attribute has changed from Set to List. If no local gateways match the specified criteria an empty list is returned (previously an error was raised)
```

```release-note:note
data-source/aws_ebs_volumes: The type of the `ids` attribute has changed from Set to List. If no volumes match the specified criteria an empty list is returned (previously an error was raised)
```

```release-note:note
data-source/aws_cognito_user_pools: The type of the `ids` and `arns` attributes has changed from Set to List. If no volumes match the specified criteria an empty list is returned (previously an error was raised)
```

```release-note:note
data-source/aws_ip_ranges: If no ranges match the specified criteria an empty list is returned (previously an error was raised)
```

```release-note:note
data-source/aws_efs_access_points: The type of the `ids` and `arns` attributes has changed from Set to List. If no access points match the specified criteria an empty list is returned (previously an error was raised)
```

```release-note:note
data-source/aws_emr_release_labels: The type of the `ids` attribute has changed from Set to List. If no release labels match the specified criteria an empty list is returned (previously an error was raised)
```

```release-note:note
data-source/aws_inspector_rules_packages: If no rules packages match the specified criteria an empty list is returned (previously an error was raised)
```

```release-note:note
data-source/aws_db_event_categories: The type of the `ids` attribute has changed from Set to List. If no event categories match the specified criteria an empty list is returned (previously an error was raised)
```

```release-note:note
data-source/aws_ssoadmin_instances: The type of the `identity_store_ids` and `arns` attributes has changed from Set to List. If no instances match the specified criteria an empty list is returned (previously an error was raised)
```
3 changes: 3 additions & 0 deletions .changelog/22043.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
data-source/aws_cloudwatch_log_group: Automatically trim `:*` suffix from `arn` attribute
```
11 changes: 11 additions & 0 deletions .changelog/22253.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
```release-note:note
resource/aws_default_subnet: If no default subnet exists in the specified Availability Zone one is now created. The `force_destroy` destroy argument has been added (defaults to `false`). Setting this argument to `true` deletes the default subnet on `terraform destroy`
```

```release-note:note
resource/aws_default_vpc: If no default VPC exists in the current AWS Region one is now created. The `force_destroy` destroy argument has been added (defaults to `false`). Setting this argument to `true` deletes the default VPC on `terraform destroy`
```

```release-note:note
data-source/aws_vpcs: The type of the `ids` attributes has changed from Set to List. If no VPCs match the specified criteria an empty list is returned (previously an error was raised)
```
7 changes: 7 additions & 0 deletions .changelog/22664.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
```release-note:note
resource/aws_route: The `instance_id` argument has been deprecated. All configurations using `instance_id` should be updated to use the `network_interface_id` argument instead
```

```release-note:note
resource/aws_route_table: The `instance_id` argument of the `route` configuration block has been deprecated. All configurations using `route` `instance_id` should be updated to use the `route` `network_interface_id` argument instead
```
3 changes: 3 additions & 0 deletions .changelog/22783.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:note
resource/aws_ecs_cluster: The `capacity_providers` and `default_capacity_provider_strategy` arguments have been deprecated. Use the `aws_ecs_cluster_capacity_providers` resource instead.
```
11 changes: 11 additions & 0 deletions .changelog/22824.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
```release-note:enhancement
resource/aws_s3_bucket_object: Rename resource to `aws_s3_object`
```

```release-note:enhancement
data-source/aws_s3_bucket_object: Rename data source to `aws_s3_object`
```

```release-note:enhancement
data-source/aws_s3_bucket_objects: Rename data source to `aws_s3_objects`
```
3 changes: 3 additions & 0 deletions .changelog/5055.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:note
data-source/aws_instances: If no instances match the specified criteria an empty list is returned (previously an error was raised)
```
3 changes: 3 additions & 0 deletions .changelog/5132.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:new-resource
aws_s3_bucket_versioning
```
3 changes: 3 additions & 0 deletions .changelog/7537.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:new-data-source
aws_eips
```
2 changes: 1 addition & 1 deletion .semgrep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ rules:
- internal/service/mq/forge_test.go
- internal/service/route53/sweep.go
- internal/service/s3/bucket_test.go
- internal/service/s3/bucket_object_test.go
- internal/service/s3/object_test.go
- internal/service/storagegateway/cached_iscsi_volume.go
- internal/service/storagegateway/cached_iscsi_volume_test.go
- internal/service/storagegateway/stored_iscsi_volume_test.go
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 4.0.0 (Unreleased)

NOTES:

* resource/aws_route: The `instance_id` argument has been deprecated. All configurations using `instance_id` should be updated to use the `network_interface_id` argument instead ([#22664](https://github.com/hashicorp/terraform-provider-aws/issues/22664))
* resource/aws_route_table: The `instance_id` argument of the `route` configuration block has been deprecated. All configurations using `route` `instance_id` should be updated to use the `route` `network_interface_id` argument instead ([#22664](https://github.com/hashicorp/terraform-provider-aws/issues/22664))

## 3.75.0 (Unreleased)
## 3.74.0 (January 28, 2022)

Expand Down
133 changes: 133 additions & 0 deletions aws/data_source_aws_instances.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
package aws

import (
"fmt"
"log"

"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/ec2"
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform/helper/validation"
)

func dataSourceAwsInstances() *schema.Resource {
return &schema.Resource{
Read: dataSourceAwsInstancesRead,

Schema: map[string]*schema.Schema{
"filter": dataSourceFiltersSchema(),
"instance_tags": tagsSchemaComputed(),
"instance_state_names": {
Type: schema.TypeSet,
Optional: true,
Elem: &schema.Schema{
Type: schema.TypeString,
ValidateFunc: validation.StringInSlice([]string{
ec2.InstanceStateNamePending,
ec2.InstanceStateNameRunning,
ec2.InstanceStateNameShuttingDown,
ec2.InstanceStateNameStopped,
ec2.InstanceStateNameStopping,
ec2.InstanceStateNameTerminated,
}, false),
},
},

"ids": {
Type: schema.TypeList,
Computed: true,
Elem: &schema.Schema{Type: schema.TypeString},
},
"private_ips": {
Type: schema.TypeList,
Computed: true,
Elem: &schema.Schema{Type: schema.TypeString},
},
"public_ips": {
Type: schema.TypeList,
Computed: true,
Elem: &schema.Schema{Type: schema.TypeString},
},
},
}
}

func dataSourceAwsInstancesRead(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).ec2conn

filters, filtersOk := d.GetOk("filter")
tags, tagsOk := d.GetOk("instance_tags")

if !filtersOk && !tagsOk {
return fmt.Errorf("One of filters or instance_tags must be assigned")
}

instanceStateNames := []*string{aws.String(ec2.InstanceStateNameRunning)}
if v, ok := d.GetOk("instance_state_names"); ok && len(v.(*schema.Set).List()) > 0 {
instanceStateNames = expandStringSet(v.(*schema.Set))
}
params := &ec2.DescribeInstancesInput{
Filters: []*ec2.Filter{
&ec2.Filter{
Name: aws.String("instance-state-name"),
Values: instanceStateNames,
},
},
}

if filtersOk {
params.Filters = append(params.Filters,
buildAwsDataSourceFilters(filters.(*schema.Set))...)
}
if tagsOk {
params.Filters = append(params.Filters, buildEC2TagFilterList(
tagsFromMap(tags.(map[string]interface{})),
)...)
}

log.Printf("[DEBUG] Reading EC2 instances: %s", params)

var instanceIds, privateIps, publicIps []string
err := conn.DescribeInstancesPages(params, func(resp *ec2.DescribeInstancesOutput, isLast bool) bool {
for _, res := range resp.Reservations {
for _, instance := range res.Instances {
instanceIds = append(instanceIds, *instance.InstanceId)
if instance.PrivateIpAddress != nil {
privateIps = append(privateIps, *instance.PrivateIpAddress)
}
if instance.PublicIpAddress != nil {
publicIps = append(publicIps, *instance.PublicIpAddress)
}
}
}
return !isLast
})
if err != nil {
return err
}

if len(instanceIds) < 1 {
return fmt.Errorf("Your query returned no results. Please change your search criteria and try again.")
}

log.Printf("[DEBUG] Found %d instances via given filter", len(instanceIds))

d.SetId(resource.UniqueId())
err = d.Set("ids", instanceIds)
if err != nil {
return err
}

err = d.Set("private_ips", privateIps)
if err != nil {
return err
}

err = d.Set("public_ips", publicIps)
if err != nil {
return err
}

return nil
}
Empty file.
4 changes: 2 additions & 2 deletions examples/s3-cross-account-access/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ resource "aws_s3_bucket" "prod" {
POLICY
}

resource "aws_s3_bucket_object" "prod" {
resource "aws_s3_object" "prod" {
provider = aws.prod

bucket = aws_s3_bucket.prod.id
Expand All @@ -50,7 +50,7 @@ provider "aws" {
secret_key = var.test_secret_key
}

resource "aws_s3_bucket_object" "test" {
resource "aws_s3_object" "test" {
provider = aws.test

bucket = aws_s3_bucket.prod.id
Expand Down
2 changes: 1 addition & 1 deletion examples/sagemaker/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ resource "aws_s3_bucket" "foo" {
force_destroy = true
}

resource "aws_s3_bucket_object" "object" {
resource "aws_s3_object" "object" {
bucket = aws_s3_bucket.foo.bucket
key = "model.tar.gz"
source = "model.tar.gz"
Expand Down
29 changes: 29 additions & 0 deletions internal/acctest/acctest.go
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,15 @@ func PreCheckRegion(t *testing.T, region string) {
}
}

// PreCheckRegionNot checks that the test region is not one of the specified regions.
func PreCheckRegionNot(t *testing.T, regions ...string) {
for _, region := range regions {
if Region() == region {
t.Skipf("skipping tests; %s (%s) not supported", conns.EnvVarDefaultRegion, region)
}
}
}

// PreCheckPartition checks that the test partition is the specified partition.
func PreCheckPartition(partition string, t *testing.T) {
if Partition() != partition {
Expand Down Expand Up @@ -1844,3 +1853,23 @@ func CheckCallerIdentityAccountID(n string) resource.TestCheckFunc {
return nil
}
}

func CheckResourceAttrGreaterThanValue(n, key, value 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 v, ok := rs.Primary.Attributes[key]; !ok || !(v > value) {
if !ok {
return fmt.Errorf("%s: Attribute %q not found", n, key)
}

return fmt.Errorf("%s: Attribute %q is not greater than %q, got %q", n, key, value, v)
}

return nil

}
}
Loading