Skip to content

Commit

Permalink
Add support for aws_batch_compute_environment (#1048)
Browse files Browse the repository at this point in the history
* Add support for aws_batch_compute_environment.

* Fix document about batch_compute_environment

* Use const instead of literal in resource_aws_batch_compute_environment.go

* Omit unnecessary parameter in resource_aws_batch_compute_environment.go

* Validate compute environment name in resource_aws_batch_compute_environment.go

* Write ComputeEnvironmentInput struct to log instead of comput environment name

* Stop writing log about changing of each fields because of unnecessity

* Use StateChangeConf to wait status of compute envrionment in AWS Batch change

* Stop validate that number of compute environment in AWS Batch are not greater than 2

Because DescribeComputeEnvironments return only one compute environment if DescribeComputeEnvironmentInput contain only one name of compute environment

* Validate format of ARN in resource_aws_batch_compute_environment.go

* Delete unused testcase in resource_aws_batch_compute_environment_test.go

* Stop checking that children of compute_resource block has change in resource_aws_batch_compute_environment.go

Because I know compute_resource block has change

* Fix document

* Use of constants from the SDK

* Use the validateArn function

* Move validateBatchComputeEnvironmentName function to validators.go

* Move codes reading compute_resources to a flatten function
  • Loading branch information
shibataka000 authored and Ninir committed Sep 19, 2017
1 parent 73a24fa commit 398dc65
Show file tree
Hide file tree
Showing 8 changed files with 1,170 additions and 0 deletions.
3 changes: 3 additions & 0 deletions aws/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"github.com/aws/aws-sdk-go/service/apigateway"
"github.com/aws/aws-sdk-go/service/applicationautoscaling"
"github.com/aws/aws-sdk-go/service/autoscaling"
"github.com/aws/aws-sdk-go/service/batch"
"github.com/aws/aws-sdk-go/service/cloudformation"
"github.com/aws/aws-sdk-go/service/cloudfront"
"github.com/aws/aws-sdk-go/service/cloudtrail"
Expand Down Expand Up @@ -176,6 +177,7 @@ type AWSClient struct {
wafconn *waf.WAF
wafregionalconn *wafregional.WAFRegional
iotconn *iot.IoT
batchconn *batch.Batch
}

func (c *AWSClient) S3() *s3.S3 {
Expand Down Expand Up @@ -384,6 +386,7 @@ func (c *Config) Client() (interface{}, error) {
client.ssmconn = ssm.New(sess)
client.wafconn = waf.New(sess)
client.wafregionalconn = wafregional.New(sess)
client.batchconn = batch.New(sess)

// Workaround for https://github.com/aws/aws-sdk-go/issues/1376
client.kinesisconn.Handlers.Retry.PushBack(func(r *request.Request) {
Expand Down
1 change: 1 addition & 0 deletions aws/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,7 @@ func Provider() terraform.ResourceProvider {
"aws_waf_sql_injection_match_set": resourceAwsWafSqlInjectionMatchSet(),
"aws_wafregional_byte_match_set": resourceAwsWafRegionalByteMatchSet(),
"aws_wafregional_ipset": resourceAwsWafRegionalIPSet(),
"aws_batch_compute_environment": resourceAwsBatchComputeEnvironment(),
},
ConfigureFunc: providerConfigure,
}
Expand Down
Loading

0 comments on commit 398dc65

Please sign in to comment.