aws: Change field names + desc according to reality

- skip_iam_creds_validation => skip_credentials_validation
 - skip_iam_account_id => skip_requesting_account_id
This commit is contained in:
Radek Simko 2016-08-10 16:46:02 +01:00
parent 2073e80c66
commit 0ab3bc4105
No known key found for this signature in database
GPG Key ID: 4DECCD28668ED457
2 changed files with 34 additions and 33 deletions

View File

@ -70,16 +70,17 @@ type Config struct {
AllowedAccountIds []interface{} AllowedAccountIds []interface{}
ForbiddenAccountIds []interface{} ForbiddenAccountIds []interface{}
DynamoDBEndpoint string DynamoDBEndpoint string
KinesisEndpoint string KinesisEndpoint string
Ec2Endpoint string Ec2Endpoint string
IamEndpoint string IamEndpoint string
ElbEndpoint string ElbEndpoint string
S3Endpoint string S3Endpoint string
Insecure bool Insecure bool
SkipIamCredsValidation bool
SkipIamAccountId bool SkipCredsValidation bool
SkipMetadataApiCheck bool SkipRequestingAccountId bool
SkipMetadataApiCheck bool
} }
type AWSClient struct { type AWSClient struct {
@ -203,7 +204,7 @@ func (c *Config) Client() (interface{}, error) {
client.iamconn = iam.New(awsIamSess) client.iamconn = iam.New(awsIamSess)
client.stsconn = sts.New(sess) client.stsconn = sts.New(sess)
if !c.SkipIamCredsValidation { if !c.SkipCredsValidation {
err = c.ValidateCredentials(client.stsconn) err = c.ValidateCredentials(client.stsconn)
if err != nil { if err != nil {
errs = append(errs, err) errs = append(errs, err)
@ -211,7 +212,7 @@ func (c *Config) Client() (interface{}, error) {
} }
} }
if !c.SkipIamAccountId { if !c.SkipRequestingAccountId {
accountId, err := GetAccountId(client.iamconn, client.stsconn, cp.ProviderName) accountId, err := GetAccountId(client.iamconn, client.stsconn, cp.ProviderName)
if err == nil { if err == nil {
client.accountid = accountId client.accountid = accountId

View File

@ -110,18 +110,18 @@ func Provider() terraform.ResourceProvider {
Description: descriptions["insecure"], Description: descriptions["insecure"],
}, },
"skip_iam_creds_validation": &schema.Schema{ "skip_credentials_validation": &schema.Schema{
Type: schema.TypeBool, Type: schema.TypeBool,
Optional: true, Optional: true,
Default: false, Default: false,
Description: descriptions["skip_iam_creds_validation"], Description: descriptions["skip_credentials_validation"],
}, },
"skip_iam_account_id": &schema.Schema{ "skip_requesting_account_id": &schema.Schema{
Type: schema.TypeBool, Type: schema.TypeBool,
Optional: true, Optional: true,
Default: false, Default: false,
Description: descriptions["skip_iam_account_id"], Description: descriptions["skip_requesting_account_id"],
}, },
"skip_metadata_api_check": &schema.Schema{ "skip_metadata_api_check": &schema.Schema{
@ -355,11 +355,11 @@ func init() {
"insecure": "Explicitly allow the provider to perform \"insecure\" SSL requests. If omitted," + "insecure": "Explicitly allow the provider to perform \"insecure\" SSL requests. If omitted," +
"default value is `false`", "default value is `false`",
"skip_iam_creds_validation": "Skip the IAM/STS credentials validation. " + "skip_credentials_validation": "Skip the credentials validation via STS API. " +
"Used for AWS API implementations that do not use IAM.", "Used for AWS API implementations that do not have STS available/implemented.",
"skip_iam_account_id": "Skip the request of account id to IAM/STS. " + "skip_requesting_account_id": "Skip requesting the account ID. " +
"Used for AWS API implementations that do not use IAM.", "Used for AWS API implementations that do not have IAM/STS API and/or metadata API.",
"skip_medatadata_api_check": "Skip the AWS Metadata API check. " + "skip_medatadata_api_check": "Skip the AWS Metadata API check. " +
"Used for AWS API implementations that do not have a metadata api endpoint.", "Used for AWS API implementations that do not have a metadata api endpoint.",
@ -368,19 +368,19 @@ func init() {
func providerConfigure(d *schema.ResourceData) (interface{}, error) { func providerConfigure(d *schema.ResourceData) (interface{}, error) {
config := Config{ config := Config{
AccessKey: d.Get("access_key").(string), AccessKey: d.Get("access_key").(string),
SecretKey: d.Get("secret_key").(string), SecretKey: d.Get("secret_key").(string),
Profile: d.Get("profile").(string), Profile: d.Get("profile").(string),
CredsFilename: d.Get("shared_credentials_file").(string), CredsFilename: d.Get("shared_credentials_file").(string),
Token: d.Get("token").(string), Token: d.Get("token").(string),
Region: d.Get("region").(string), Region: d.Get("region").(string),
MaxRetries: d.Get("max_retries").(int), MaxRetries: d.Get("max_retries").(int),
DynamoDBEndpoint: d.Get("dynamodb_endpoint").(string), DynamoDBEndpoint: d.Get("dynamodb_endpoint").(string),
KinesisEndpoint: d.Get("kinesis_endpoint").(string), KinesisEndpoint: d.Get("kinesis_endpoint").(string),
Insecure: d.Get("insecure").(bool), Insecure: d.Get("insecure").(bool),
SkipIamCredsValidation: d.Get("skip_iam_creds_validation").(bool), SkipCredsValidation: d.Get("skip_credentials_validation").(bool),
SkipIamAccountId: d.Get("skip_iam_account_id").(bool), SkipRequestingAccountId: d.Get("skip_requesting_account_id").(bool),
SkipMetadataApiCheck: d.Get("skip_metadata_api_check").(bool), SkipMetadataApiCheck: d.Get("skip_metadata_api_check").(bool),
} }
endpointsSet := d.Get("endpoints").(*schema.Set) endpointsSet := d.Get("endpoints").(*schema.Set)