Skip to content

Commit

Permalink
Add assumeRoleWithWebIdentity to creds validation #2252
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas11 committed Dec 4, 2023
1 parent db55339 commit a6bfb10
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions provider/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,18 @@ func validateCredentials(vars resource.PropertyMap, c shim.ResourceConfig) error
SessionName: stringValue(details.ObjectValue(), "sessionName", []string{}),
}
config.AssumeRole = &assumeRole
}

if details, ok := vars["assumeRoleWithWebIdentity"]; ok {
assumeRole := awsbase.AssumeRoleWithWebIdentity{
RoleARN: stringValue(details.ObjectValue(), "roleArn", []string{}),
Policy: stringValue(details.ObjectValue(), "policy", []string{}),
PolicyARNs: arrayValue(details.ObjectValue(), "policyArns", []string{}),
SessionName: stringValue(details.ObjectValue(), "sessionName", []string{}),
WebIdentityToken: stringValue(details.ObjectValue(), "webIdentityToken", []string{}),
WebIdentityTokenFile: stringValue(details.ObjectValue(), "webIdentityTokenFile", []string{}),
}
config.AssumeRoleWithWebIdentity = &assumeRole
}

// By default `skipMetadataApiCheck` is true for Pulumi to speed operations
Expand Down

0 comments on commit a6bfb10

Please sign in to comment.