provider/aws: Change aws_iam_role description to not pass empty string

This commit is contained in:
stack72 2017-05-04 18:46:36 +03:00
parent 410fdad2cb
commit fff5fed0f0
No known key found for this signature in database
GPG Key ID: 8619A619B085CB16

View File

@ -82,7 +82,7 @@ func resourceAwsIamRole() *schema.Resource {
ForceNew: true,
},
"description": &schema.Schema{
"description": {
Type: schema.TypeString,
Optional: true,
},
@ -117,10 +117,13 @@ func resourceAwsIamRoleCreate(d *schema.ResourceData, meta interface{}) error {
request := &iam.CreateRoleInput{
Path: aws.String(d.Get("path").(string)),
RoleName: aws.String(name),
Description: aws.String(d.Get("description").(string)),
AssumeRolePolicyDocument: aws.String(d.Get("assume_role_policy").(string)),
}
if v, ok := d.GetOk("description"); ok {
request.Description = aws.String(v.(string))
}
var createResp *iam.CreateRoleOutput
err := resource.Retry(30*time.Second, func() *resource.RetryError {
var err error