mirror of
https://github.com/thegeeklab/wp-opentofu.git
synced 2024-11-24 23:30:39 +00:00
returning true only when all credentials are set
This commit is contained in:
parent
8d8f5c4d78
commit
5876dd5a26
@ -172,12 +172,12 @@ func CopyTfEnv() {
|
|||||||
func credsSet() bool {
|
func credsSet() bool {
|
||||||
awsTokens := []string{"AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN"}
|
awsTokens := []string{"AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN"}
|
||||||
for _, token := range awsTokens {
|
for _, token := range awsTokens {
|
||||||
if os.Getenv(token) != "" {
|
if os.Getenv(token) == "" {
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
func assumeRole(roleArn string) {
|
func assumeRole(roleArn string) {
|
||||||
client := sts.New(session.New())
|
client := sts.New(session.New())
|
||||||
|
Loading…
Reference in New Issue
Block a user