diff --git a/builder/amazon/common/access_config.go b/builder/amazon/common/access_config.go index c03ed4f0e..52041c0fd 100644 --- a/builder/amazon/common/access_config.go +++ b/builder/amazon/common/access_config.go @@ -17,12 +17,12 @@ import ( // AccessConfig is for common configuration related to AWS access type AccessConfig struct { - AccessKey string `mapstructure:"access_key"` - SecretKey string `mapstructure:"secret_key"` - RawRegion string `mapstructure:"region"` - SkipValidation bool `mapstructure:"skip_region_validation"` - Token string `mapstructure:"token"` - ProfileName string `mapstructure:"profile"` + AccessKey string `mapstructure:"access_key"` + SecretKey string `mapstructure:"secret_key"` + RawRegion string `mapstructure:"region"` + SkipValidation bool `mapstructure:"skip_region_validation"` + Token string `mapstructure:"token"` + ProfileName string `mapstructure:"profile"` } // Config returns a valid aws.Config object for access to AWS services, or @@ -66,7 +66,7 @@ func (c *AccessConfig) Config() (*aws.Config, error) { // the region from the instance metadata if possible. func (c *AccessConfig) Region() (string, error) { if c.RawRegion != "" { - if(c.SkipValidation == false) { + if c.SkipValidation == false { if valid := ValidateRegion(c.RawRegion); valid == false { return "", fmt.Errorf("Not a valid region: %s", c.RawRegion) } @@ -86,7 +86,7 @@ func (c *AccessConfig) Region() (string, error) { func (c *AccessConfig) Prepare(ctx *interpolate.Context) []error { var errs []error if c.RawRegion != "" { - if(c.SkipValidation == false) { + if c.SkipValidation == false { if valid := ValidateRegion(c.RawRegion); valid == false { errs = append(errs, fmt.Errorf("Unknown region: %s", c.RawRegion)) } diff --git a/builder/amazon/common/access_config_test.go b/builder/amazon/common/access_config_test.go index 9c8b3acfc..20d4851ba 100644 --- a/builder/amazon/common/access_config_test.go +++ b/builder/amazon/common/access_config_test.go @@ -37,5 +37,4 @@ func TestAccessConfigPrepare_Region(t *testing.T) { } c.SkipValidation = false - } diff --git a/builder/amazon/common/ami_config.go b/builder/amazon/common/ami_config.go index 3c759fe7e..6767bc607 100644 --- a/builder/amazon/common/ami_config.go +++ b/builder/amazon/common/ami_config.go @@ -8,17 +8,17 @@ import ( // AMIConfig is for common configuration related to creating AMIs. type AMIConfig struct { - AMIName string `mapstructure:"ami_name"` - AMIDescription string `mapstructure:"ami_description"` - AMIVirtType string `mapstructure:"ami_virtualization_type"` - AMIUsers []string `mapstructure:"ami_users"` - AMIGroups []string `mapstructure:"ami_groups"` - AMIProductCodes []string `mapstructure:"ami_product_codes"` - AMIRegions []string `mapstructure:"ami_regions"` - AMISkipRegionValidation bool `mapstructure:"skip_region_validation"` - AMITags map[string]string `mapstructure:"tags"` - AMIEnhancedNetworking bool `mapstructure:"enhanced_networking"` - AMIForceDeregister bool `mapstructure:"force_deregister"` + AMIName string `mapstructure:"ami_name"` + AMIDescription string `mapstructure:"ami_description"` + AMIVirtType string `mapstructure:"ami_virtualization_type"` + AMIUsers []string `mapstructure:"ami_users"` + AMIGroups []string `mapstructure:"ami_groups"` + AMIProductCodes []string `mapstructure:"ami_product_codes"` + AMIRegions []string `mapstructure:"ami_regions"` + AMISkipRegionValidation bool `mapstructure:"skip_region_validation"` + AMITags map[string]string `mapstructure:"tags"` + AMIEnhancedNetworking bool `mapstructure:"enhanced_networking"` + AMIForceDeregister bool `mapstructure:"force_deregister"` } func (c *AMIConfig) Prepare(ctx *interpolate.Context) []error {