Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

Filter calling OpsWorksUserProfile #174

Merged
merged 1 commit into from
Mar 28, 2018

Conversation

stephanlindauer
Copy link
Contributor

This prevents the attached error when attempting deletion of this resource via filtering beforehand:

[slindauer] mordor-east-1 - OpsWorksUserProfile - 'arn:aws:iam::XXXXXXXXXXXX:user/foobar' - ValidationException: Cannot delete self
[slindauer]     status code: 400, request id: XXXXXXXXX-XXXX-XXXX-XXXXXXXX

Please review @rebuy-de/prp-aws-nuke

@stephanlindauer
Copy link
Contributor Author

stephanlindauer commented Mar 28, 2018

Hm, maybe it's better to retrieve GetCallerIdentity in the constructor and then just save that ID to the struct... 🤔

func (f *OpsWorksUserProfile) Filter() error {
identityOutput, err := sts.New(f.sess).GetCallerIdentity(nil)
if err != nil {
return fmt.Errorf("Preventively filtered because CallerIdentity cannot be determined")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error should be logged.

@stephanlindauer stephanlindauer force-pushed the filter_calling_opsworksuserprofile branch from 155c78f to 653b286 Compare March 28, 2018 12:16
@stephanlindauer stephanlindauer force-pushed the filter_calling_opsworksuserprofile branch from 653b286 to a949e0b Compare March 28, 2018 12:17
@stephanlindauer
Copy link
Contributor Author

Please review again @rebuy-de/prp-aws-nuke

@stephanlindauer stephanlindauer merged commit dce60ab into master Mar 28, 2018
@stephanlindauer stephanlindauer deleted the filter_calling_opsworksuserprofile branch March 28, 2018 12:27
@svenwltr svenwltr added the kind/bug Something isn't working label Mar 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants