Skip to content

Commit

Permalink
Merge pull request #1 from terraform-providers/master
Browse files Browse the repository at this point in the history
Sync with Upstream
  • Loading branch information
pradeepbhadani authored Oct 1, 2017
2 parents 8c7518b + fe37a32 commit c43e208
Show file tree
Hide file tree
Showing 36 changed files with 2,056 additions and 145 deletions.
117 changes: 68 additions & 49 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,64 +1,83 @@
## 1.0.0 (Unreleased)
## 1.0.1 (Unreleased)

FEATURES:

* **New Resource:** `aws_batch_job_definition` [GH-1710]
* **New Resource:** `aws_batch_job_queue` [GH-1710]

IMPROVEMENTS:

* resource/aws_cloudwatch_log_group: Add support for encryption via `kms_key_id` [GH-1751]
* resource/aws_spot_instance_request: Add support for `instance_interruption_behaviour` [GH-1735]

BUG FIXES:

* resource/aws_kinesis_firehose_delivery_stream: Fix crash caused by missing `processing_configuration` [GH-1738]
* resource/aws_rds_cluster_instance: Treat `configuring-enhanced-monitoring` as pending state [GH-1744]
* data-source/aws_db_instance: Make `db_instance_arn` expose ARN instead of identifier (use `db_cluster_identifier` for identifier) [GH-1766]

## 1.0.0 (September 27, 2017)

NOTES:

* resource/aws_appautoscaling_policy: Nest step scaling policy fields, deprecate 1st level fields [GH-1620]
* resource/aws_appautoscaling_policy: Nest step scaling policy fields, deprecate 1st level fields ([#1620](https://github.com/terraform-providers/terraform-provider-aws/issues/1620))

FEATURES:

* **New Resource:** `aws_waf_rate_based_rule` [GH-1606]
* **New Resource:** `aws_batch_compute_environment` [GH-1048]
* **New Resource:** `aws_waf_rate_based_rule` ([#1606](https://github.com/terraform-providers/terraform-provider-aws/issues/1606))
* **New Resource:** `aws_batch_compute_environment` ([#1048](https://github.com/terraform-providers/terraform-provider-aws/issues/1048))

IMPROVEMENTS:

* provider: Expand shared_credentials_file [GH-1511]
* provider: Add support for Task Roles when running on ECS or CodeBuild [GH-1425]
* resource/aws_instance: New `user_data_base64` attribute that allows non-UTF8 data (such as gzip) to be assigned to user-data without corruption [GH-850]
* data-source/aws_vpc: Expose enable_dns_* in aws_vpc data_source [GH-1373]
* resource/aws_directory_service_directory: Add support for `tags` [GH-1398]
* resource/aws_rds_cluster: Allow setting of rds cluster engine [GH-1415]
* resource/aws_ssm_association: now supports update for `parameters`, `schedule_expression`,`output_location` [GH-1421]
* resource/aws_ssm_patch_baseline: now supports update for multiple attributes [GH-1421]
* resource/aws_cloudformation_stack: Add support for Import [GH-1432]
* resource/aws_rds_cluster_instance: Expose availability_zone attribute [GH-1439]
* resource/aws_efs_file_system: Add support for encryption [GH-1420]
* resource/aws_db_parameter_group: Allow underscores in names [GH-1460]
* resource/aws_elasticsearch_domain: Assign tags right after creation [GH-1399]
* resource/aws_route53_record: Allow CAA record type [GH-1467]
* resource/aws_codebuild_project: Allowed for BITBUCKET source type [GH-1468]
* resource/aws_emr_cluster: Add `instance_group` parameter for EMR clusters [GH-1071]
* resource/aws_alb_listener_rule: Populate `listener_arn` field [GH-1303]
* resource/aws_api_gateway_rest_api: Add a body property to API Gateway RestAPI for Swagger import support [GH-1197]
* resource/aws_opsworks_stack: Add support for tags [GH-1523]
* Add retries for AppScaling policies throttling exceptions [GH-1430]
* resource/aws_ssm_patch_baseline: Add compliance level to patch approval rules [GH-1531]
* resource/aws_ssm_activation: Export ssm activation activation_code [GH-1570]
* resource/aws_network_interface: Added private_dns_name to network_interface [GH-1599]
* data-source/aws_redshift_service_account: updated with latest redshift service account ID's [GH-1614]
* resource/aws_ssm_parameter: Refresh from state on 404 [GH-1436]
* resource/aws_api_gateway_rest_api: Allow binary media types to be updated [GH-1600]
* resource/aws_waf_rule: Make `predicates`' `data_id` required (it always was on the API's side, it's just reflected in the schema) [GH-1606]
* resource/aws_waf_web_acl: Introduce new `type` field in `rules` to allow referencing `RATE_BASED` type [GH-1606]
* resource/aws_ssm_association: Migrate the schema to use association_id [GH-1579]
* resource/aws_ssm_document: Added name validation [GH-1638]
* resource/aws_nat_gateway: Add tags support [GH-1625]
* resource/aws_route53_record: Add support for Route53 multi-value answer routing policy [GH-1686]
* resource/aws_instance: Read iops only when volume type is io1 [GH-1573]
* Allow RDS Cluster / Cluster instance to specify the engine [GH-1591]
* resource/aws_cloudwatch_event_target: Add Input transformer for Cloudwatch Events [GH-1343]
* resource/aws_directory_service_directory: Support Import functionality [GH-1732]
* provider: Expand shared_credentials_file ([#1511](https://github.com/terraform-providers/terraform-provider-aws/issues/1511))
* provider: Add support for Task Roles when running on ECS or CodeBuild ([#1425](https://github.com/terraform-providers/terraform-provider-aws/issues/1425))
* resource/aws_instance: New `user_data_base64` attribute that allows non-UTF8 data (such as gzip) to be assigned to user-data without corruption ([#850](https://github.com/terraform-providers/terraform-provider-aws/issues/850))
* data-source/aws_vpc: Expose enable_dns_* in aws_vpc data_source ([#1373](https://github.com/terraform-providers/terraform-provider-aws/issues/1373))
* resource/aws_appautoscaling_policy: Add support for DynamoDB ([#1650](https://github.com/terraform-providers/terraform-provider-aws/issues/1650))
* resource/aws_directory_service_directory: Add support for `tags` ([#1398](https://github.com/terraform-providers/terraform-provider-aws/issues/1398))
* resource/aws_rds_cluster: Allow setting of rds cluster engine ([#1415](https://github.com/terraform-providers/terraform-provider-aws/issues/1415))
* resource/aws_ssm_association: now supports update for `parameters`, `schedule_expression`,`output_location` ([#1421](https://github.com/terraform-providers/terraform-provider-aws/issues/1421))
* resource/aws_ssm_patch_baseline: now supports update for multiple attributes ([#1421](https://github.com/terraform-providers/terraform-provider-aws/issues/1421))
* resource/aws_cloudformation_stack: Add support for Import ([#1432](https://github.com/terraform-providers/terraform-provider-aws/issues/1432))
* resource/aws_rds_cluster_instance: Expose availability_zone attribute ([#1439](https://github.com/terraform-providers/terraform-provider-aws/issues/1439))
* resource/aws_efs_file_system: Add support for encryption ([#1420](https://github.com/terraform-providers/terraform-provider-aws/issues/1420))
* resource/aws_db_parameter_group: Allow underscores in names ([#1460](https://github.com/terraform-providers/terraform-provider-aws/issues/1460))
* resource/aws_elasticsearch_domain: Assign tags right after creation ([#1399](https://github.com/terraform-providers/terraform-provider-aws/issues/1399))
* resource/aws_route53_record: Allow CAA record type ([#1467](https://github.com/terraform-providers/terraform-provider-aws/issues/1467))
* resource/aws_codebuild_project: Allowed for BITBUCKET source type ([#1468](https://github.com/terraform-providers/terraform-provider-aws/issues/1468))
* resource/aws_emr_cluster: Add `instance_group` parameter for EMR clusters ([#1071](https://github.com/terraform-providers/terraform-provider-aws/issues/1071))
* resource/aws_alb_listener_rule: Populate `listener_arn` field ([#1303](https://github.com/terraform-providers/terraform-provider-aws/issues/1303))
* resource/aws_api_gateway_rest_api: Add a body property to API Gateway RestAPI for Swagger import support ([#1197](https://github.com/terraform-providers/terraform-provider-aws/issues/1197))
* resource/aws_opsworks_stack: Add support for tags ([#1523](https://github.com/terraform-providers/terraform-provider-aws/issues/1523))
* Add retries for AppScaling policies throttling exceptions ([#1430](https://github.com/terraform-providers/terraform-provider-aws/issues/1430))
* resource/aws_ssm_patch_baseline: Add compliance level to patch approval rules ([#1531](https://github.com/terraform-providers/terraform-provider-aws/issues/1531))
* resource/aws_ssm_activation: Export ssm activation activation_code ([#1570](https://github.com/terraform-providers/terraform-provider-aws/issues/1570))
* resource/aws_network_interface: Added private_dns_name to network_interface ([#1599](https://github.com/terraform-providers/terraform-provider-aws/issues/1599))
* data-source/aws_redshift_service_account: updated with latest redshift service account ID's ([#1614](https://github.com/terraform-providers/terraform-provider-aws/issues/1614))
* resource/aws_ssm_parameter: Refresh from state on 404 ([#1436](https://github.com/terraform-providers/terraform-provider-aws/issues/1436))
* resource/aws_api_gateway_rest_api: Allow binary media types to be updated ([#1600](https://github.com/terraform-providers/terraform-provider-aws/issues/1600))
* resource/aws_waf_rule: Make `predicates`' `data_id` required (it always was on the API's side, it's just reflected in the schema) ([#1606](https://github.com/terraform-providers/terraform-provider-aws/issues/1606))
* resource/aws_waf_web_acl: Introduce new `type` field in `rules` to allow referencing `RATE_BASED` type ([#1606](https://github.com/terraform-providers/terraform-provider-aws/issues/1606))
* resource/aws_ssm_association: Migrate the schema to use association_id ([#1579](https://github.com/terraform-providers/terraform-provider-aws/issues/1579))
* resource/aws_ssm_document: Added name validation ([#1638](https://github.com/terraform-providers/terraform-provider-aws/issues/1638))
* resource/aws_nat_gateway: Add tags support ([#1625](https://github.com/terraform-providers/terraform-provider-aws/issues/1625))
* resource/aws_route53_record: Add support for Route53 multi-value answer routing policy ([#1686](https://github.com/terraform-providers/terraform-provider-aws/issues/1686))
* resource/aws_instance: Read iops only when volume type is io1 ([#1573](https://github.com/terraform-providers/terraform-provider-aws/issues/1573))
* resource/aws_rds_cluster(+_instance) Allow specifying the engine ([#1591](https://github.com/terraform-providers/terraform-provider-aws/issues/1591))
* resource/aws_cloudwatch_event_target: Add Input transformer for Cloudwatch Events ([#1343](https://github.com/terraform-providers/terraform-provider-aws/issues/1343))
* resource/aws_directory_service_directory: Support Import functionality ([#1732](https://github.com/terraform-providers/terraform-provider-aws/issues/1732))

BUG FIXES:

* resource/aws_instance: Fix `associate_public_ip_address` [GH-1340]
* resource/aws_instance: Fix import in EC2 Classic [GH-1453]
* resource/aws_emr_cluster: Avoid spurious diff of `log_uri` [GH-1374]
* resource/aws_cloudwatch_log_subscription_filter: Add support for ResourceNotFound [GH-1414]
* resource/aws_sns_topic_subscription: Prevent duplicate (un)subscribe during initial creation [GH-1480]
* resource/aws_alb: Cleanup ENIs after deleting ALB [GH-1427]
* resource/aws_s3_bucket: Wrap s3 calls in retry to avoid race during creation [GH-891]
* resource/aws_eip: Remove from state on deletion [GH-1551]
* resource/aws_security_group: Adding second scenario where IPv6 is not supported [GH-880]
* resource/aws_instance: Fix `associate_public_ip_address` ([#1340](https://github.com/terraform-providers/terraform-provider-aws/issues/1340))
* resource/aws_instance: Fix import in EC2 Classic ([#1453](https://github.com/terraform-providers/terraform-provider-aws/issues/1453))
* resource/aws_emr_cluster: Avoid spurious diff of `log_uri` ([#1374](https://github.com/terraform-providers/terraform-provider-aws/issues/1374))
* resource/aws_cloudwatch_log_subscription_filter: Add support for ResourceNotFound ([#1414](https://github.com/terraform-providers/terraform-provider-aws/issues/1414))
* resource/aws_sns_topic_subscription: Prevent duplicate (un)subscribe during initial creation ([#1480](https://github.com/terraform-providers/terraform-provider-aws/issues/1480))
* resource/aws_alb: Cleanup ENIs after deleting ALB ([#1427](https://github.com/terraform-providers/terraform-provider-aws/issues/1427))
* resource/aws_s3_bucket: Wrap s3 calls in retry to avoid race during creation ([#891](https://github.com/terraform-providers/terraform-provider-aws/issues/891))
* resource/aws_eip: Remove from state on deletion ([#1551](https://github.com/terraform-providers/terraform-provider-aws/issues/1551))
* resource/aws_security_group: Adding second scenario where IPv6 is not supported ([#880](https://github.com/terraform-providers/terraform-provider-aws/issues/880))

## 0.1.4 (August 08, 2017)

Expand Down
2 changes: 1 addition & 1 deletion aws/data_source_aws_db_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ func dataSourceAwsDbInstanceRead(d *schema.ResourceData, meta interface{}) error
d.Set("availability_zone", dbInstance.AvailabilityZone)
d.Set("backup_retention_period", dbInstance.BackupRetentionPeriod)
d.Set("db_cluster_identifier", dbInstance.DBClusterIdentifier)
d.Set("db_instance_arn", dbInstance.DBClusterIdentifier)
d.Set("db_instance_arn", dbInstance.DBInstanceArn)
d.Set("db_instance_class", dbInstance.DBInstanceClass)
d.Set("db_name", dbInstance.DBName)

Expand Down
52 changes: 52 additions & 0 deletions aws/import_aws_lambda_function_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,64 @@ package aws

import (
"fmt"
"log"
"strings"
"testing"

"github.com/aws/aws-sdk-go/service/lambda"
"github.com/hashicorp/terraform/helper/acctest"
"github.com/hashicorp/terraform/helper/resource"
)

func init() {
resource.AddTestSweepers("aws_lambda_function", &resource.Sweeper{
Name: "aws_lambda_function",
F: testSweepLambdaFunctions,
})
}

func testSweepLambdaFunctions(region string) error {
client, err := sharedClientForRegion(region)
if err != nil {
return fmt.Errorf("error getting client: %s", err)
}

lambdaconn := client.(*AWSClient).lambdaconn

resp, err := lambdaconn.ListFunctions(&lambda.ListFunctionsInput{})
if err != nil {
return fmt.Errorf("Error retrieving Lambda functions: %s", err)
}

if len(resp.Functions) == 0 {
log.Print("[DEBUG] No aws lambda functions to sweep")
return nil
}

for _, f := range resp.Functions {
var testOptGroup bool
for _, testName := range []string{"tf_test"} {
if strings.HasPrefix(*f.FunctionName, testName) {
testOptGroup = true
}
}

if !testOptGroup {
continue
}

_, err := lambdaconn.DeleteFunction(
&lambda.DeleteFunctionInput{
FunctionName: f.FunctionName,
})
if err != nil {
return err
}
}

return nil
}

func TestAccAWSLambdaFunction_importLocalFile(t *testing.T) {
resourceName := "aws_lambda_function.lambda_function_test"

Expand Down
2 changes: 2 additions & 0 deletions aws/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,8 @@ func Provider() terraform.ResourceProvider {
"aws_wafregional_byte_match_set": resourceAwsWafRegionalByteMatchSet(),
"aws_wafregional_ipset": resourceAwsWafRegionalIPSet(),
"aws_batch_compute_environment": resourceAwsBatchComputeEnvironment(),
"aws_batch_job_definition": resourceAwsBatchJobDefinition(),
"aws_batch_job_queue": resourceAwsBatchJobQueue(),
},
ConfigureFunc: providerConfigure,
}
Expand Down
6 changes: 3 additions & 3 deletions aws/resource_aws_api_gateway_authorizer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
func TestAccAWSAPIGatewayAuthorizer_basic(t *testing.T) {
var conf apigateway.Authorizer

expectedAuthUri := regexp.MustCompile("arn:aws:apigateway:region:lambda:path/2015-03-31/functions/" +
expectedAuthUri := regexp.MustCompile("arn:aws:apigateway:[a-z0-9-]+:lambda:path/2015-03-31/functions/" +
"arn:aws:lambda:[a-z0-9-]+:[0-9]{12}:function:tf_acc_api_gateway_authorizer/invocations")
expectedCreds := regexp.MustCompile("arn:aws:iam::[0-9]{12}:role/tf_acc_api_gateway_auth_invocation_role")

Expand Down Expand Up @@ -303,7 +303,7 @@ const testAccAWSAPIGatewayAuthorizerConfig = testAccAWSAPIGatewayAuthorizerConfi
resource "aws_api_gateway_authorizer" "test" {
name = "tf-acc-test-authorizer"
rest_api_id = "${aws_api_gateway_rest_api.test.id}"
authorizer_uri = "arn:aws:apigateway:region:lambda:path/2015-03-31/functions/${aws_lambda_function.authorizer.arn}/invocations"
authorizer_uri = "${aws_lambda_function.authorizer.invoke_arn}"
authorizer_credentials = "${aws_iam_role.invocation_role.arn}"
}
`
Expand All @@ -312,7 +312,7 @@ const testAccAWSAPIGatewayAuthorizerUpdatedConfig = testAccAWSAPIGatewayAuthoriz
resource "aws_api_gateway_authorizer" "test" {
name = "tf-acc-test-authorizer_modified"
rest_api_id = "${aws_api_gateway_rest_api.test.id}"
authorizer_uri = "arn:aws:apigateway:region:lambda:path/2015-03-31/functions/${aws_lambda_function.authorizer.arn}/invocations"
authorizer_uri = "${aws_lambda_function.authorizer.invoke_arn}"
authorizer_credentials = "${aws_iam_role.invocation_role.arn}"
authorizer_result_ttl_in_seconds = 360
identity_validation_expression = ".*"
Expand Down
2 changes: 1 addition & 1 deletion aws/resource_aws_api_gateway_method_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ resource "aws_lambda_function" "authorizer" {
resource "aws_api_gateway_authorizer" "test" {
name = "tf-acc-test-authorizer"
rest_api_id = "${aws_api_gateway_rest_api.test.id}"
authorizer_uri = "arn:aws:apigateway:region:lambda:path/2015-03-31/functions/${aws_lambda_function.authorizer.arn}/invocations"
authorizer_uri = "${aws_lambda_function.authorizer.invoke_arn}"
authorizer_credentials = "${aws_iam_role.invocation_role.arn}"
}
Expand Down
Loading

0 comments on commit c43e208

Please sign in to comment.