Skip to content

Commit 776bc47

Browse files
committed
Merge remote-tracking branch 'upstream' into feature/additional_zones
2 parents 038d330 + d1b34d3 commit 776bc47

238 files changed

Lines changed: 21440 additions & 1186 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ install:
1111
- bash scripts/gogetcookie.sh
1212
script:
1313
- make test vet
14+
- GOOS=windows go build
1415
branches:
1516
only:
1617
- master

CHANGELOG.md

Lines changed: 79 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,91 @@
1-
## 0.8.3 (unreleased)
1+
## 0.8.5 (Unreleased)
22

33
FEATURES:
44

5-
* **New Provider:** `Ignition` [GH-6189]
6-
* **New Data Source:** `aws_vpc_peering_connection` [GH-10913]
7-
* **New Resource:** `azurerm_container_registry` [GH-10973]
8-
* **New Resource:** `azurerm_eventhub_authorization_rule` [GH-10971]
9-
* **New Resource:** `azurerm_eventhub_consumer_group` [GH-9902]
5+
* **New Data Source:** `aws_elb_hosted_zone_id ` [GH-11027]
106

117
IMPROVEMENTS:
8+
9+
* provider/aws: Add 'route_table_id' to route_table data source ([#11157](https://github.com/hashicorp/terraform/pull/11157))
10+
* provider/aws: Add Support for aws_cloudwatch_metric_alarm extended statistic [GH-11193]
11+
* provider/azurerm: add caching support for virtual_machine data_disks [GH-11142]
12+
* provider/azurerm: make lb sub resources idempotent [GH-11128]
13+
* provider/google: Add subnetwork_project field to enable cross-project networking in instance templates [GH-11110]
14+
* provider/openstack: LoadBalancer Security Groups [GH-11074]
15+
* provider/statuscake: Add support for StatusCake confirmation servers [GH-11179]
16+
17+
BUG FIXES:
18+
19+
* provider/aws: Fix panic when querying VPC's main route table via data source ([#11134](https://github.com/hashicorp/terraform/issues/11134))
20+
* provider/aws: Allow creating aws_codecommit repository outside of us-east-1 [GH-11177]
21+
22+
## 0.8.4 (January 11, 2017)
23+
24+
BACKWARDS INCOMPATIBILITIES / NOTES:
25+
26+
* We have removed the `Arukas` provider that was added in v0.8.3 for this release. Unfortunately we found the
27+
new provider included a dependency that would not compile and run on Windows operating systems. For now the
28+
provider has been removed and we hope to work to reintroduce it for all platforms in the near future. Going forward we will also be taking additional steps in our build testing to ensure Terraform builds on all platforms before release.
1229

13-
* provider/archive: `archive_file` now exports `output_md5` attribute in addition to existing SHA1 and Base64 SHA256 hashes. [GH-10851]
14-
* provider/aws: Add `most_recent` to the `ebs_snapshot` data source [GH-10986]
15-
* provider/aws: Add support for instance tenancy in `aws_opsworks_instance` [GH-10885]
16-
* provider/aws: Added a validation for security group rule types [GH-10864]
17-
* provider:aws: Add support for updating aws_emr_cluster parameters [GH-11008]
18-
* provider/azurerm: Azure resource providers which are already registered are no longer re-registered. [GH-10991]
19-
* provider/docker: Add network create --internal flag support [GH-10932]
20-
* provider/docker: Add support for a list of pull_triggers within the docker_image resource. [GH-10845]
21-
* provider/pagerduty Add delete support to `pagerduty_service_integration` [GH-10891]
22-
* provider/postgresql Add permissions support to `postgresql_schema` as nested `policy` attributes [GH-10808]
30+
## 0.8.3 (January 10, 2017)
31+
32+
FEATURES:
33+
34+
* **New Provider:** `Arukas` ([#10862](https://github.com/hashicorp/terraform/issues/10862))
35+
* **New Provider:** `Ignition` ([#6189](https://github.com/hashicorp/terraform/issues/6189))
36+
* **New Provider:** `OpsGenie` ([#11012](https://github.com/hashicorp/terraform/issues/11012))
37+
* **New Data Source:** `aws_vpc_peering_connection` ([#10913](https://github.com/hashicorp/terraform/issues/10913))
38+
* **New Resource:** `aws_codedeploy_deployment_config` ([#11062](https://github.com/hashicorp/terraform/issues/11062))
39+
* **New Resource:** `azurerm_container_registry` ([#10973](https://github.com/hashicorp/terraform/issues/10973))
40+
* **New Resource:** `azurerm_eventhub_authorization_rule` ([#10971](https://github.com/hashicorp/terraform/issues/10971))
41+
* **New Resource:** `azurerm_eventhub_consumer_group` ([#9902](https://github.com/hashicorp/terraform/issues/9902))
42+
43+
IMPROVEMENTS:
44+
45+
* command/fmt: Show filename on parse error ([#10923](https://github.com/hashicorp/terraform/issues/10923))
46+
* provider/archive: `archive_file` now exports `output_md5` attribute in addition to existing SHA1 and Base64 SHA256 hashes. ([#10851](https://github.com/hashicorp/terraform/issues/10851))
47+
* provider/aws: Add `most_recent` to the `ebs_snapshot` data source ([#10986](https://github.com/hashicorp/terraform/issues/10986))
48+
* provider/aws: Add support for instance tenancy in `aws_opsworks_instance` ([#10885](https://github.com/hashicorp/terraform/issues/10885))
49+
* provider/aws: Added a validation for security group rule types ([#10864](https://github.com/hashicorp/terraform/issues/10864))
50+
* provider:aws: Add support for updating aws_emr_cluster parameters ([#11008](https://github.com/hashicorp/terraform/issues/11008))
51+
* provider/aws: Add Placement Constraints to `aws_ecs_task_definition` ([#11030](https://github.com/hashicorp/terraform/issues/11030))
52+
* provider/aws: Increasing timeout for redshift cluster creation to 75 minutes ([#11041](https://github.com/hashicorp/terraform/issues/11041))
53+
* provider/aws: Add support for content_handling to aws_api_gateway_integration_response ([#11002](https://github.com/hashicorp/terraform/issues/11002))
54+
* provider/aws: Add S3 bucket name validation ([#11116](https://github.com/hashicorp/terraform/issues/11116))
55+
* provider/aws: Add Route53 Record type validation ([#11119](https://github.com/hashicorp/terraform/issues/11119))
56+
* provider/azurerm: support non public clouds ([#11026](https://github.com/hashicorp/terraform/issues/11026))
57+
* provider/azurerm: Azure resource providers which are already registered are no longer re-registered. ([#10991](https://github.com/hashicorp/terraform/issues/10991))
58+
* provider/docker: Add network create --internal flag support ([#10932](https://github.com/hashicorp/terraform/issues/10932))
59+
* provider/docker: Add support for a list of pull_triggers within the docker_image resource. ([#10845](https://github.com/hashicorp/terraform/issues/10845))
60+
* provider/pagerduty Add delete support to `pagerduty_service_integration` ([#10891](https://github.com/hashicorp/terraform/issues/10891))
61+
* provider/postgresql Add permissions support to `postgresql_schema` as nested `policy` attributes ([#10808](https://github.com/hashicorp/terraform/issues/10808))
2362

2463
BUG FIXES:
2564

26-
* provider/aws: Guard against nil change output in `route53_zone` that causes panic [GH-10798]
27-
* provider/aws: Reworked validateArn function to handle empty values [GH-10833]
28-
* provider/aws: Set `aws_autoscaling_policy` `metric_aggregation_type` to be Computed [GH-10904]
29-
* provider/aws: `storage_class` is now correctly treated as optional when configuring replication for `aws_s3_bucket` resources. [GH-10921]
30-
* provider/aws: `user_data` on `aws_launch_configuration` resources is only base 64 encoded if the value provided is not already base 64 encoded. [GH-10871]
31-
* provider/aws: Add snapshotting to the list of pending state for elasticache [GH-10965]
32-
* provider/aws: Add support for updating tags in aws_emr_cluster [GH-11003]
33-
* provider/aws: Fix the normalization of AWS policy statements [GH-11009]
34-
* provider/aws: data_source_aws_iam_server_certificate latest should be bool not string causes panic [GH-11016]
35-
* provider/google: Fix backwards incompatibility around create_timeout in instances [GH-10858]
36-
* provider/openstack: Handle `PENDING_UPDATE` status with LBaaS v2 members [GH-10875]
65+
* core: Properly expand sets as lists from a flatmap [[#11042](https://github.com/hashicorp/terraform/issues/11042)]
66+
* core: Disallow root modules named "root" as a temporary workaround ([#11099](https://github.com/hashicorp/terraform/issues/11099))
67+
* command/fmt: Lists of heredocs format properly ([#10947](https://github.com/hashicorp/terraform/issues/10947))
68+
* command/graph: Fix crash when `-type=legacy` ([#11095](https://github.com/hashicorp/terraform/issues/11095))
69+
* provider/aws: Guard against nil change output in `route53_zone` that causes panic ([#10798](https://github.com/hashicorp/terraform/issues/10798))
70+
* provider/aws: Reworked validateArn function to handle empty values ([#10833](https://github.com/hashicorp/terraform/issues/10833))
71+
* provider/aws: Set `aws_autoscaling_policy` `metric_aggregation_type` to be Computed ([#10904](https://github.com/hashicorp/terraform/issues/10904))
72+
* provider/aws: `storage_class` is now correctly treated as optional when configuring replication for `aws_s3_bucket` resources. ([#10921](https://github.com/hashicorp/terraform/issues/10921))
73+
* provider/aws: `user_data` on `aws_launch_configuration` resources is only base 64 encoded if the value provided is not already base 64 encoded. ([#10871](https://github.com/hashicorp/terraform/issues/10871))
74+
* provider/aws: Add snapshotting to the list of pending state for elasticache ([#10965](https://github.com/hashicorp/terraform/issues/10965))
75+
* provider/aws: Add support for updating tags in aws_emr_cluster ([#11003](https://github.com/hashicorp/terraform/issues/11003))
76+
* provider/aws: Fix the normalization of AWS policy statements ([#11009](https://github.com/hashicorp/terraform/issues/11009))
77+
* provider/aws: data_source_aws_iam_server_certificate latest should be bool not string causes panic ([#11016](https://github.com/hashicorp/terraform/issues/11016))
78+
* provider/aws: Fix typo in aws_redshift_cluster causing security groups to not allow update ([#11025](https://github.com/hashicorp/terraform/issues/11025))
79+
* provider/aws: Set `key_name` in `aws_key_pair` if omited in configuration ([#10987](https://github.com/hashicorp/terraform/issues/10987))
80+
* provider/aws: Updating the aws_efs_mount_target dns_name ([#11023](https://github.com/hashicorp/terraform/issues/11023))
81+
* provider/aws: Validate window time format for snapshot times and backup windows on RDS and ElastiCache resources ([#11089](https://github.com/hashicorp/terraform/issues/11089))
82+
* provider/aws: aws_db_instance restored from snapshot had problem with subnet_group ([#11050](https://github.com/hashicorp/terraform/issues/11050))
83+
* provider/aws: Allow disabled access_log in ELB ([#11120](https://github.com/hashicorp/terraform/issues/11120))
84+
* provider/azurerm: fix update protocol for lb_probe ([#11125](https://github.com/hashicorp/terraform/issues/11125))
85+
* provider/google: Fix backwards incompatibility around create_timeout in instances ([#10858](https://github.com/hashicorp/terraform/issues/10858))
86+
* provider/google: google_compute_instance_group_manager update_strategy not properly read ([#10174](https://github.com/hashicorp/terraform/issues/10174))
87+
* provider/openstack: Handle `PENDING_UPDATE` status with LBaaS v2 members ([#10875](https://github.com/hashicorp/terraform/issues/10875))
88+
* provider/rancher: Add 'finishing-upgrade' state to rancher stack ([#11019](https://github.com/hashicorp/terraform/issues/11019))
3789

3890

3991
## 0.8.2 (December 21, 2016)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ Assuming your work is on a branch called `my-feature-branch`, the steps look lik
8888
go get github.com/hashicorp/my-project
8989
```
9090

91-
2. Add the new package to your vendor/ directory:
91+
2. Add the new package to your `vendor/` directory:
9292

9393
```bash
9494
govendor add github.com/hashicorp/my-project/package
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package main
2+
3+
import (
4+
"github.com/hashicorp/terraform/builtin/providers/opsgenie"
5+
"github.com/hashicorp/terraform/plugin"
6+
)
7+
8+
func main() {
9+
plugin.Serve(&plugin.ServeOpts{
10+
ProviderFunc: opsgenie.Provider,
11+
})
12+
}

builtin/providers/aws/config.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ import (
5252
"github.com/aws/aws-sdk-go/service/route53"
5353
"github.com/aws/aws-sdk-go/service/s3"
5454
"github.com/aws/aws-sdk-go/service/ses"
55+
"github.com/aws/aws-sdk-go/service/sfn"
5556
"github.com/aws/aws-sdk-go/service/simpledb"
5657
"github.com/aws/aws-sdk-go/service/sns"
5758
"github.com/aws/aws-sdk-go/service/sqs"
@@ -141,6 +142,7 @@ type AWSClient struct {
141142
glacierconn *glacier.Glacier
142143
codedeployconn *codedeploy.CodeDeploy
143144
codecommitconn *codecommit.CodeCommit
145+
sfnconn *sfn.SFN
144146
ssmconn *ssm.SSM
145147
wafconn *waf.WAF
146148
}
@@ -264,7 +266,7 @@ func (c *Config) Client() (interface{}, error) {
264266
client.cloudwatchconn = cloudwatch.New(sess)
265267
client.cloudwatcheventsconn = cloudwatchevents.New(sess)
266268
client.cloudwatchlogsconn = cloudwatchlogs.New(sess)
267-
client.codecommitconn = codecommit.New(usEast1Sess)
269+
client.codecommitconn = codecommit.New(sess)
268270
client.codedeployconn = codedeploy.New(sess)
269271
client.dsconn = directoryservice.New(sess)
270272
client.dynamodbconn = dynamodb.New(dynamoSess)
@@ -292,6 +294,7 @@ func (c *Config) Client() (interface{}, error) {
292294
client.simpledbconn = simpledb.New(sess)
293295
client.s3conn = s3.New(awsS3Sess)
294296
client.sesConn = ses.New(sess)
297+
client.sfnconn = sfn.New(sess)
295298
client.snsconn = sns.New(sess)
296299
client.sqsconn = sqs.New(sess)
297300
client.ssmconn = ssm.New(sess)
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
package aws
2+
3+
import (
4+
"fmt"
5+
6+
"github.com/hashicorp/terraform/helper/schema"
7+
)
8+
9+
// See https://github.com/fog/fog-aws/pull/332/files
10+
// This list isn't exposed by AWS - it's been found through
11+
// trouble solving
12+
var elbHostedZoneIdPerRegionMap = map[string]string{
13+
"ap-northeast-1": "Z14GRHDCWA56QT",
14+
"ap-northeast-2": "ZWKZPGTI48KDX",
15+
"ap-south-1": "ZP97RAFLXTNZK",
16+
"ap-southeast-1": "Z1LMS91P8CMLE5",
17+
"ap-southeast-2": "Z1GM3OXH4ZPM65",
18+
"ca-central-1": "ZQSVJUPU6J1EY",
19+
"eu-central-1": "Z215JYRZR1TBD5",
20+
"eu-west-1": "Z32O12XQLNTSW2",
21+
"eu-west-2": "ZHURV8PSTC4K8",
22+
"us-east-1": "Z35SXDOTRQ7X7K",
23+
"us-east-2": "Z3AADJGX6KTTL2",
24+
"us-west-1": "Z368ELLRRE2KJ0",
25+
"us-west-2": "Z1H1FL5HABSF5",
26+
"sa-east-1": "Z2P70J7HTTTPLU",
27+
}
28+
29+
func dataSourceAwsElbHostedZoneId() *schema.Resource {
30+
return &schema.Resource{
31+
Read: dataSourceAwsElbHostedZoneIdRead,
32+
33+
Schema: map[string]*schema.Schema{
34+
"region": {
35+
Type: schema.TypeString,
36+
Optional: true,
37+
},
38+
},
39+
}
40+
}
41+
42+
func dataSourceAwsElbHostedZoneIdRead(d *schema.ResourceData, meta interface{}) error {
43+
region := meta.(*AWSClient).region
44+
if v, ok := d.GetOk("region"); ok {
45+
region = v.(string)
46+
}
47+
48+
if zoneId, ok := elbHostedZoneIdPerRegionMap[region]; ok {
49+
d.SetId(zoneId)
50+
return nil
51+
}
52+
53+
return fmt.Errorf("Unknown region (%q)", region)
54+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
package aws
2+
3+
import (
4+
"testing"
5+
6+
"github.com/hashicorp/terraform/helper/resource"
7+
)
8+
9+
func TestAccAWSElbHostedZoneId_basic(t *testing.T) {
10+
resource.Test(t, resource.TestCase{
11+
PreCheck: func() { testAccPreCheck(t) },
12+
Providers: testAccProviders,
13+
Steps: []resource.TestStep{
14+
{
15+
Config: testAccCheckAwsElbHostedZoneIdConfig,
16+
Check: resource.ComposeTestCheckFunc(
17+
resource.TestCheckResourceAttr("data.aws_elb_hosted_zone_id.main", "id", "Z1H1FL5HABSF5"),
18+
),
19+
},
20+
{
21+
Config: testAccCheckAwsElbHostedZoneIdExplicitRegionConfig,
22+
Check: resource.ComposeTestCheckFunc(
23+
resource.TestCheckResourceAttr("data.aws_elb_hosted_zone_id.regional", "id", "Z32O12XQLNTSW2"),
24+
),
25+
},
26+
},
27+
})
28+
}
29+
30+
const testAccCheckAwsElbHostedZoneIdConfig = `
31+
data "aws_elb_hosted_zone_id" "main" { }
32+
`
33+
34+
const testAccCheckAwsElbHostedZoneIdExplicitRegionConfig = `
35+
data "aws_elb_hosted_zone_id" "regional" {
36+
region = "eu-west-1"
37+
}
38+
`

builtin/providers/aws/data_source_aws_route_table.go

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ func dataSourceAwsRouteTable() *schema.Resource {
1818
Optional: true,
1919
Computed: true,
2020
},
21+
"route_table_id": {
22+
Type: schema.TypeString,
23+
Optional: true,
24+
Computed: true,
25+
},
2126
"vpc_id": {
2227
Type: schema.TypeString,
2328
Optional: true,
@@ -98,14 +103,16 @@ func dataSourceAwsRouteTableRead(d *schema.ResourceData, meta interface{}) error
98103
req := &ec2.DescribeRouteTablesInput{}
99104
vpcId, vpcIdOk := d.GetOk("vpc_id")
100105
subnetId, subnetIdOk := d.GetOk("subnet_id")
106+
rtbId, rtbOk := d.GetOk("route_table_id")
101107
tags, tagsOk := d.GetOk("tags")
102108
filter, filterOk := d.GetOk("filter")
103109

104-
if !vpcIdOk && !subnetIdOk && !tagsOk && !filterOk {
105-
return fmt.Errorf("One of vpc_id, subnet_id, filters, or tags must be assigned")
110+
if !vpcIdOk && !subnetIdOk && !tagsOk && !filterOk && !rtbOk {
111+
return fmt.Errorf("One of route_table_id, vpc_id, subnet_id, filters, or tags must be assigned")
106112
}
107113
req.Filters = buildEC2AttributeFilterList(
108114
map[string]string{
115+
"route-table-id": rtbId.(string),
109116
"vpc-id": vpcId.(string),
110117
"association.subnet-id": subnetId.(string),
111118
},
@@ -197,7 +204,10 @@ func dataSourceAssociationsRead(ec2Assocations []*ec2.RouteTableAssociation) []m
197204
m := make(map[string]interface{})
198205
m["route_table_id"] = *a.RouteTableId
199206
m["route_table_association_id"] = *a.RouteTableAssociationId
200-
m["subnet_id"] = *a.SubnetId
207+
// GH[11134]
208+
if a.SubnetId != nil {
209+
m["subnet_id"] = *a.SubnetId
210+
}
201211
m["main"] = *a.Main
202212
associations = append(associations, m)
203213
}

0 commit comments

Comments
 (0)