Skip to content

AccessKey credentials are reset on every cluster creation #637

@jbpratt

Description

@jbpratt

Access keys are being reset on every rosa create cluster ... call such that subsequent calls (rosa list clusters) failed due to invalid credentials. These credentials are also used when working with the ocm CLI so it is causing issues for my team since we store these. Would it be possible to not upsert the access keys on cluster creation or perhaps suggest an alternative workflow? cc'ing @jharrington22 since they wrote the code and explanation.

rosa/pkg/aws/client.go

Lines 471 to 494 in 7b3efee

// GetAWSAccessKeys uses UpsertAccessKey to delete and create new access keys
// for `osdCcsAdmin` each time we use the client to create a cluster.
// There is no need to permanently store these credentials since they are only used
// on create, the cluster uses a completely different set of IAM credentials
// provisioned by this user.
func (c *awsClient) GetAWSAccessKeys() (*AccessKey, error) {
if c.awsAccessKeys != nil {
return c.awsAccessKeys, nil
}
accessKey, err := c.UpsertAccessKey(AdminUserName)
if err != nil {
return nil, err
}
err = c.ValidateAccessKeys(accessKey)
if err != nil {
return nil, err
}
c.awsAccessKeys = accessKey
return c.awsAccessKeys, nil
}

❯ rosa list clusters
E: Failed to create AWS client: InvalidClientTokenId: The security token included in the request is invalid.
	status code: 403, request id: 77591dc5-8d54-4282-9ec9-b20xyzabc658eb

Metadata

Metadata

Assignees

No one assigned

    Labels

    lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions