-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:coveo/terraform-provider-aws into…
… new-ssm-parameters-features
- Loading branch information
Showing
1,433 changed files
with
360,199 additions
and
13,401 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,3 +32,4 @@ website/vendor | |
|
||
# Keep windows files with windows line endings | ||
*.winfile eol=crlf | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Build customization | ||
builds: | ||
- binary: terraform-provider-aws | ||
goos: | ||
- windows | ||
- darwin | ||
- linux | ||
goarch: | ||
- amd64 | ||
- 386 | ||
ignore: | ||
- goos: darwin | ||
goarch: 386 | ||
|
||
# Archive customization | ||
archive: | ||
format: zip | ||
|
||
replacements: | ||
amd64: 64-bits | ||
386: 32-bits | ||
darwin: macOS | ||
|
||
files: | ||
- nothing.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package aws | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/hashicorp/terraform/helper/schema" | ||
) | ||
|
||
// See http://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-supported-regions.html | ||
var cloudTrailServiceAccountPerRegionMap = map[string]string{ | ||
"us-east-1": "086441151436", | ||
"us-east-2": "475085895292", | ||
"us-west-1": "388731089494", | ||
"us-west-2": "113285607260", | ||
"ap-south-1": "977081816279", | ||
"ap-northeast-2": "492519147666", | ||
"ap-southeast-1": "903692715234", | ||
"ap-southeast-2": "284668455005", | ||
"ap-northeast-1": "216624486486", | ||
"ca-central-1": "819402241893", | ||
"eu-central-1": "035351147821", | ||
"eu-west-1": "859597730677", | ||
"eu-west-2": "282025262664", | ||
"sa-east-1": "814480443879", | ||
} | ||
|
||
func dataSourceAwsCloudTrailServiceAccount() *schema.Resource { | ||
return &schema.Resource{ | ||
Read: dataSourceAwsCloudTrailServiceAccountRead, | ||
|
||
Schema: map[string]*schema.Schema{ | ||
"region": &schema.Schema{ | ||
Type: schema.TypeString, | ||
Optional: true, | ||
}, | ||
"arn": { | ||
Type: schema.TypeString, | ||
Computed: true, | ||
}, | ||
}, | ||
} | ||
} | ||
|
||
func dataSourceAwsCloudTrailServiceAccountRead(d *schema.ResourceData, meta interface{}) error { | ||
region := meta.(*AWSClient).region | ||
if v, ok := d.GetOk("region"); ok { | ||
region = v.(string) | ||
} | ||
|
||
if accid, ok := cloudTrailServiceAccountPerRegionMap[region]; ok { | ||
d.SetId(accid) | ||
d.Set("arn", iamArnString(meta.(*AWSClient).partition, accid, "root")) | ||
return nil | ||
} | ||
|
||
return fmt.Errorf("Unknown region (%q)", region) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package aws | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/hashicorp/terraform/helper/resource" | ||
) | ||
|
||
func TestAccAWSCloudTrailServiceAccount_basic(t *testing.T) { | ||
resource.Test(t, resource.TestCase{ | ||
PreCheck: func() { testAccPreCheck(t) }, | ||
Providers: testAccProviders, | ||
Steps: []resource.TestStep{ | ||
resource.TestStep{ | ||
Config: testAccCheckAwsCloudTrailServiceAccountConfig, | ||
Check: resource.ComposeTestCheckFunc( | ||
resource.TestCheckResourceAttr("data.aws_cloudtrail_service_account.main", "id", "113285607260"), | ||
resource.TestCheckResourceAttr("data.aws_cloudtrail_service_account.main", "arn", "arn:aws:iam::113285607260:root"), | ||
), | ||
}, | ||
resource.TestStep{ | ||
Config: testAccCheckAwsCloudTrailServiceAccountExplicitRegionConfig, | ||
Check: resource.ComposeTestCheckFunc( | ||
resource.TestCheckResourceAttr("data.aws_cloudtrail_service_account.regional", "id", "282025262664"), | ||
resource.TestCheckResourceAttr("data.aws_cloudtrail_service_account.regional", "arn", "arn:aws:iam::282025262664:root"), | ||
), | ||
}, | ||
}, | ||
}) | ||
} | ||
|
||
const testAccCheckAwsCloudTrailServiceAccountConfig = ` | ||
data "aws_cloudtrail_service_account" "main" { } | ||
` | ||
|
||
const testAccCheckAwsCloudTrailServiceAccountExplicitRegionConfig = ` | ||
data "aws_cloudtrail_service_account" "regional" { | ||
region = "eu-west-2" | ||
} | ||
` |
Oops, something went wrong.