Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

assume_role_policy_document not idempotent #10

Open
st33v opened this issue Nov 12, 2015 · 1 comment
Open

assume_role_policy_document not idempotent #10

st33v opened this issue Nov 12, 2015 · 1 comment

Comments

@st33v
Copy link

st33v commented Nov 12, 2015

I have exported to ruby and I've been experimenting with miam by periodically doing a dry-run to compare what I exported with what is currently in my environment.

I've found that this:

role "CloudTrail_CloudWatchLogs_Role", :path=>"/" do
  instance_profiles(
    # no instance_profile
  )

  assume_role_policy_document do
    {"Version"=>"2012-10-17",
     "Statement"=>
      [{"Sid"=>"",
        "Effect"=>"Allow",
        "Principal"=>
         {"Service"=>
           ["cloudtrail.amazonaws.com", "cloudtrail.preprod.amazonaws.com"]},
        "Action"=>"sts:AssumeRole"}]}
  end
...

seems to pop up as an 'Update' when there has been no actual change:

Update Role `CloudTrail_CloudWatchLogs_Role` > AssumeRolePolicy (dry-run)
  {"Version"=>"2012-10-17",
   "Statement"=>
    [{"Sid"=>"",
      "Effect"=>"Allow",
      "Principal"=>
       {"Service"=>
         ["cloudtrail.amazonaws.com", "cloudtrail.preprod.amazonaws.com"]},
      "Action"=>"sts:AssumeRole"}]} (dry-run)

I only see the problem on assume_role_policy_documents where there is more than one Principal=>Service. I suspect a sorting problem or array comparison problem in that var when it's an array.

winebarrel pushed a commit that referenced this issue Nov 13, 2015
@winebarrel
Copy link
Collaborator

Sorry for reply late.
I think that it has been fixed in the following commit:

8881173

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants