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

Add SSM Support #141

Merged
merged 1 commit into from
Mar 16, 2018
Merged

Add SSM Support #141

merged 1 commit into from
Mar 16, 2018

Conversation

tomvachon
Copy link
Contributor

No description provided.


_, err := f.svc.DeleteAssociation(&ssm.DeleteAssociationInput{
AssociationId: f.associationID,
//InstanceId: f.instanceID,
Copy link
Contributor

Choose a reason for hiding this comment

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

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Whoops I was testing something. Let me double check the results but I dont think it was a mandatory flag

svc: svc,
ID: baselineIdentity.BaselineId,
})
} else if !strings.Contains(*baselineIdentity.BaselineDescription, "Provided by AWS") {
Copy link
Contributor

Choose a reason for hiding this comment

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

To filter resources I would generally recommend the Filter() function. E.g.:

func (e *IAMRolePolicyAttachment) Filter() error {
if strings.HasPrefix(e.policyArn, "arn:aws:iam::aws:policy/aws-service-role/") {
return fmt.Errorf("cannot detach from service roles")
}
return nil
}

In this case, I actually think your approach in SSMDocument is really great. It reduces the number of resources returned and let's AWS do the filter work. I tried it briefly with aws ssm describe-patch-baselines --filters="Key=OWNER,Values=Self" and it looks promising. Wdyt?

Copy link
Contributor Author

@tomvachon tomvachon Mar 14, 2018

Choose a reason for hiding this comment

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

I have an issue with Patch Baselines, which I am not sure will be easy to resolve, you can't delete the default. So either we accept that, or we make a ton of conditional coding to find the right AWS provided one which matches the right OS. Thoughts?

Its a bit irrelevant to this, but I wanted to mention it

Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't filtering by Owner=Self resolve that issue?

@tomvachon
Copy link
Contributor Author

Moving this to a top level question:

I have an issue with Patch Baselines, which I am not sure will be easy to resolve, you can't delete the default. So either we accept that, or we make a ton of conditional coding to find the right AWS provided one which matches the right OS. Thoughts?

Its a bit irrelevant to this, but I wanted to mention it

@tomvachon
Copy link
Contributor Author

@bethge moving this to Top level, no, it doesnt. You can make your own a default. Then you need to make a non-nuked resource one, it might be a "put a pin in it" issue and see how often it creeps up

@tomvachon
Copy link
Contributor Author

I removed the comment after a test to ensure that was proper

@bethge
Copy link
Contributor

bethge commented Mar 15, 2018

Ah ok, I see the problem now.

Looking at Terraform's implementation of PatchBaseline, they also do not handle deleting the default PatchBaseline deletion.

I would suggest we gracefully handle this case by filtering PatchBaseline resources with DefaultBaseline=true via the Filter() function. That would allow us to tell the user why we cannot delete that particular PatchBaseline resource.

@tomvachon
Copy link
Contributor Author

@bethge resolved

@bethge bethge merged commit 71ead7f into rebuy-de:master Mar 16, 2018
@tomvachon tomvachon deleted the feature/ssm branch March 16, 2018 17:01
@svenwltr svenwltr added the kind/resource Adding or changing AWS resources. label Mar 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/resource Adding or changing AWS resources.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants