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

Multiple Dry Runs Show Same resources #1215

Closed
altoic opened this issue May 23, 2017 · 4 comments
Closed

Multiple Dry Runs Show Same resources #1215

altoic opened this issue May 23, 2017 · 4 comments

Comments

@altoic
Copy link

altoic commented May 23, 2017

So testing a basic vpc check for an email tag

policies:
  - name: VPCTags
    resource: vpc
    filters:
      - "tag:Default": absent
    actions:
      - type: mark
        key: CloudCustodianIdentified
        value: Missing email tag

I run

custodian run --dryrun -s . vpctag.yml
2017-05-23 14:45:35,308 - custodian.policy - INFO - policy: VPCTags resource:vpc region:us-east-2 count:4 time:0.00

Then tried to add that 'Default' tag on 2 VPCs hoping something would take effect

custodian run --dryrun -s . vpctag.yml
2017-05-23 14:47:49,008 - custodian.policy - INFO - policy: VPCTags resource:vpc region:us-east-2 count:4 time:0.00

The same amount of VPCs will have actionable items. Looks like it is caching API calls? Maybe?
Is this not the proper method of performing dry runs?

@tim-elliott
Copy link
Contributor

Yes, there is caching of results. You can avoid that by using the --cache-period option with a value of 0, i.e.
custodian run --dryrun --cache-period 0 -s . vpctag.yml

@altoic
Copy link
Author

altoic commented May 23, 2017

thanks @tim-elliott problem solved.

BTW how are people finding these unique values to set? I feel like to get very familiar with this I would have to just dive straight into the source.

@tim-elliott
Copy link
Contributor

The -h option is available with most if not all custodian commands. So custodian run -h will give you the valid options for the run command, with brief explanations, including

  --cache-period CACHE_PERIOD
                        Cache validity in minutes (default 15)

@altoic
Copy link
Author

altoic commented May 23, 2017

thanks. just had to go one step deeper...

@altoic altoic closed this as completed May 23, 2017
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