Skip to content

Commit

Permalink
Cosmetics.
Browse files Browse the repository at this point in the history
  • Loading branch information
ewbankkit committed Apr 18, 2024
1 parent 136f475 commit 538c779
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions internal/service/autoscaling/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,6 @@ func resourceGroup() *schema.Resource {
Optional: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"auto_rollback": {
Type: schema.TypeBool,
Optional: true,
},
"alarm_specification": {
Type: schema.TypeList,
MaxItems: 1,
Expand All @@ -244,10 +240,17 @@ func resourceGroup() *schema.Resource {
Schema: map[string]*schema.Schema{
"alarms": {

Check failure on line 241 in internal/service/autoscaling/group.go

View workflow job for this annotation

GitHub Actions / providerlint

S013: schema should configure one of Computed, Optional, or Required
Type: schema.TypeList,
Elem: &schema.Schema{
Type: schema.TypeString,
},
},
},
},
},
"auto_rollback": {
Type: schema.TypeBool,
Optional: true,
},
"checkpoint_delay": {
Type: nullable.TypeNullableInt,
Optional: true,
Expand Down Expand Up @@ -3314,12 +3317,12 @@ func expandRefreshPreferences(tfMap map[string]interface{}) *awstypes.RefreshPre

apiObject := &awstypes.RefreshPreferences{}

if v, ok := tfMap["auto_rollback"].(bool); ok {
apiObject.AutoRollback = aws.Bool(v)
if v, ok := tfMap["alarm_specification"].([]interface{}); ok && len(v) > 0 {
apiObject.AlarmSpecification = expandAlarmSpecification(v[0].(map[string]interface{}))
}

if v, ok := tfMap["alarm_specification"].([]interface{}); ok && len(v) > 0 {
apiObject.AlarmSpecification = expandRefreshAlarmSpecification(v[0].(map[string]interface{}))
if v, ok := tfMap["auto_rollback"].(bool); ok {
apiObject.AutoRollback = aws.Bool(v)
}

if v, ok := tfMap["checkpoint_delay"].(string); ok {
Expand Down Expand Up @@ -3361,7 +3364,7 @@ func expandRefreshPreferences(tfMap map[string]interface{}) *awstypes.RefreshPre
return apiObject
}

func expandRefreshAlarmSpecification(tfMap map[string]interface{}) *awstypes.AlarmSpecification {
func expandAlarmSpecification(tfMap map[string]interface{}) *awstypes.AlarmSpecification {
if tfMap == nil {
return nil
}
Expand Down

0 comments on commit 538c779

Please sign in to comment.