Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tech-debt: update opsworks_slack attr and tests and enumerated values in opsworks resources #14886

Merged
merged 3 commits into from
Aug 28, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 6 additions & 20 deletions aws/resource_aws_opsworks_application.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,9 @@ func resourceAwsOpsworksApplication() *schema.Resource {
ForceNew: true,
},
"type": {
Type: schema.TypeString,
Required: true,
ValidateFunc: validation.StringInSlice([]string{
opsworks.AppTypeAwsFlowRuby,
opsworks.AppTypeJava,
opsworks.AppTypeRails,
opsworks.AppTypePhp,
opsworks.AppTypeNodejs,
opsworks.AppTypeStatic,
opsworks.AppTypeOther,
}, false),
Type: schema.TypeString,
Required: true,
ValidateFunc: validation.StringInSlice(opsworks.AppType_Values(), false),
},
"stack_id": {
Type: schema.TypeString,
Expand Down Expand Up @@ -77,15 +69,9 @@ func resourceAwsOpsworksApplication() *schema.Resource {
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"type": {
Type: schema.TypeString,
Required: true,
ValidateFunc: validation.StringInSlice([]string{
opsworks.SourceTypeGit,
opsworks.SourceTypeSvn,
opsworks.SourceTypeArchive,
opsworks.SourceTypeS3,
"other",
}, false),
Type: schema.TypeString,
Required: true,
ValidateFunc: validation.StringInSlice(opsworks.SourceType_Values(), false),
anGie44 marked this conversation as resolved.
Show resolved Hide resolved
},

"url": {
Expand Down
46 changes: 17 additions & 29 deletions aws/resource_aws_opsworks_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,16 @@ func resourceAwsOpsworksInstance() *schema.Resource {
},

"architecture": {
Type: schema.TypeString,
Optional: true,
Default: "x86_64",
ValidateFunc: validation.StringInSlice([]string{
opsworks.ArchitectureX8664,
opsworks.ArchitectureI386,
}, false),
Type: schema.TypeString,
Optional: true,
Default: "x86_64",
ValidateFunc: validation.StringInSlice(opsworks.Architecture_Values(), false),
},

"auto_scaling_type": {
Type: schema.TypeString,
Optional: true,
ValidateFunc: validation.StringInSlice([]string{
opsworks.AutoScalingTypeLoad,
opsworks.AutoScalingTypeTimer,
}, false),
Type: schema.TypeString,
Optional: true,
ValidateFunc: validation.StringInSlice(opsworks.AutoScalingType_Values(), false),
},

"availability_zone": {
Expand Down Expand Up @@ -223,14 +217,11 @@ func resourceAwsOpsworksInstance() *schema.Resource {
},

"root_device_type": {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Computed: true,
ValidateFunc: validation.StringInSlice([]string{
opsworks.RootDeviceTypeEbs,
opsworks.RootDeviceTypeInstanceStore,
}, false),
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Computed: true,
ValidateFunc: validation.StringInSlice(opsworks.RootDeviceType_Values(), false),
},

"root_device_volume_id": {
Expand Down Expand Up @@ -305,14 +296,11 @@ func resourceAwsOpsworksInstance() *schema.Resource {
},

"virtualization_type": {
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
ValidateFunc: validation.StringInSlice([]string{
opsworks.VirtualizationTypeParavirtual,
opsworks.VirtualizationTypeHvm,
}, false),
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
ValidateFunc: validation.StringInSlice(opsworks.VirtualizationType_Values(), false),
},

"ebs_block_device": {
Expand Down
5 changes: 3 additions & 2 deletions aws/resource_aws_opsworks_stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,9 @@ func resourceAwsOpsworksStack() *schema.Resource {
},

"custom_json": {
Type: schema.TypeString,
Optional: true,
Type: schema.TypeString,
Optional: true,
DiffSuppressFunc: suppressEquivalentJsonDiffs,
},

"default_availability_zone": {
Expand Down
Loading