diff --git a/aws/resource_aws_cognito_identity_pool_roles_attachment.go b/aws/resource_aws_cognito_identity_pool_roles_attachment.go index 6007515517c..5030331b961 100644 --- a/aws/resource_aws_cognito_identity_pool_roles_attachment.go +++ b/aws/resource_aws_cognito_identity_pool_roles_attachment.go @@ -125,10 +125,10 @@ func resourceAwsCognitoIdentityPoolRolesAttachmentCreate(d *schema.ResourceData, return fmt.Errorf("Error validating ambiguous role resolution: %v", errors) } - params.RoleMappings = expandCognitoIdentityPoolRoleMappingsAttachment(v.([]interface{})) + params.RoleMappings = expandCognitoIdentityPoolRoleMappingsAttachment(v.(*schema.Set).List()) } - log.Sprintf("[DEBUG] Creating Cognito Identity Pool Roles Association: %#v", params) + log.Printf("[DEBUG] Creating Cognito Identity Pool Roles Association: %#v", params) _, err := conn.SetIdentityPoolRoles(params) if err != nil { return fmt.Errorf("Error creating Cognito Identity Pool Roles Association: %s", err) @@ -198,7 +198,7 @@ func resourceAwsCognitoIdentityPoolRolesAttachmentUpdate(d *schema.ResourceData, params.RoleMappings = expandCognitoIdentityPoolRoleMappingsAttachment(mappings) } - log.Sprintf("[DEBUG] Updating Cognito Identity Pool Roles Association: %#v", params) + log.Printf("[DEBUG] Updating Cognito Identity Pool Roles Association: %#v", params) _, err := conn.SetIdentityPoolRoles(params) if err != nil { return fmt.Errorf("Error updating Cognito Identity Pool Roles Association: %s", err) diff --git a/aws/resource_aws_cognito_identity_pool_roles_attachment_test.go b/aws/resource_aws_cognito_identity_pool_roles_attachment_test.go index df1776b7df4..8d0a9ba5fee 100644 --- a/aws/resource_aws_cognito_identity_pool_roles_attachment_test.go +++ b/aws/resource_aws_cognito_identity_pool_roles_attachment_test.go @@ -187,9 +187,10 @@ func testAccCheckAWSCognitoIdentityPoolRolesAttachmentDestroy(s *terraform.State return nil } -const baseAWSCognitoIdentityPoolRolesAttachmentConfig = ` +func baseAWSCognitoIdentityPoolRolesAttachmentConfig(name string) string { + return fmt.Sprintf(` resource "aws_cognito_identity_pool" "main" { - identity_pool_name = "identity pool %s" + identity_pool_name = "identity pool %[1]s" allow_unauthenticated_identities = false supported_login_providers { @@ -199,7 +200,7 @@ resource "aws_cognito_identity_pool" "main" { # Unauthenticated Role resource "aws_iam_role" "unauthenticated" { - name = "cognito_unauthenticated_%s" + name = "cognito_unauthenticated_%[1]s" assume_role_policy = <