Commit graph

84 commits

Author SHA1 Message Date
ChefRycar
84b34b9a4d Updating aws_iam_user with exists? function. (#115)
* Updating aws_iam_user with exists? function. Solves #114

Signed-off-by: Nick Rycar <rycar@chef.io>

* Disabling class length rubocop rule.

Signed-off-by: Nick Rycar <rycar@chef.io>
2017-11-22 14:30:18 +01:00
Clinton Wolfe
351b200a88 Add Cloudwatch Log Metric Filter resource (#116)
* Full docs, first draft; integration tests; started on unit tests
* Integration tests pass
* Docs update 
* More consistent syntax in examples
* Alter fetch phase to perform fetch, handle results, and unpack into instance vars, more like other resources
2017-11-22 12:32:19 +01:00
Clinton Wolfe
ab2170f717 Add aws_sns_topic resource (#120)
* Docs first draft, integration tests, and constructor unit tests for SNS topic

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Skeleton of SNS topic

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Constructor arg validation works

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Passing unit tests for recall

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Subscription Count property, works

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Subscription, not subscriber

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Integration tests pass; also wildard ARNs are not allowed

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Rubocop changes

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Doc updates per kagarmoe

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2017-11-17 01:44:43 +07:00
Clinton Wolfe
c99f7e318f Copied .rubocop.yml from core inspec (#118)
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2017-11-08 19:58:24 +01:00
Chris Redekop
58b5eed035 Add AWS_SESSION_TOKEN (#107)
* Add AWS_SESSION_TOKEN

Signed-off-by: Chris Redekop <chris.redekop@d2l.com>

* Update README to include session-token env var

Signed-off-by: Chris Redekop <chris.redekop@d2l.com>
2017-10-30 18:39:38 +01:00
Clinton Wolfe
82dc6f3ec7
Documentation for existing resources
* Update docs in source to use matcher-style calls, not properties-as-predicates

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Main doc file for aws_iam_user

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Add documentation for existing resources

This adds documentation for the following resources, including custom matchers:

  - aws_ec2_instance
  - aws_iam_access_key
  - aws_iam_password_policy
  - aws_iam_root_user
  - aws_iam_users

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>

* Fix `aws_iam_users` example (Console + No MFA) (#104)

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>

* Correct copypasta

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Remove misleading singular matcher information from the plural docs for aws_iam_users

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Correct `aws-iam-userss` typo (#105)

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>

* Add EC2 instance state info

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* test commit

Signed-off-by: kgarmoe <kgarmoe@chef.io>

* copy edits

Signed-off-by: kgarmoe <kgarmoe@chef.io>

* Yikes, forgot to save after correcting a merge conflict

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2017-10-27 16:31:36 -04:00
Jerry Aldrich III
7b91c58210 Modify aws_iam_user example to use RSpec matcher
Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2017-10-27 11:06:49 -04:00
Chris Redekop
c8d4244ef4 Add has_roles to aws_ec2_instance (#90)
* Rename EC2-instance resources

Signed-off-by: Chris Redekop <chris.redekop@d2l.com>

* Add interim updates

Signed-off-by: Chris Redekop <chris.redekop@d2l.com>

* testing for issue 82

Signed-off-by: Simon Varlow <simon.varlow@d2l.com>

* completed integration for EC2 roles

Signed-off-by: Simon Varlow <simon.varlow@d2l.com>

* adding in the beginning of the unit test for issue 82

Signed-off-by: Simon Varlow <simon.varlow@d2l.com>

* Fix unit tests

Signed-off-by: Chris Redekop <chris.redekop@d2l.com>

* Add has_roles? examples

Signed-off-by: Chris Redekop <chris.redekop@d2l.com>

* Remove redundant gsub

Signed-off-by: Chris Redekop <chris.redekop@d2l.com>

* corrected OpenStruct format

Signed-off-by: Simon Varlow <simon.varlow@d2l.com>

* setting up variable for InstanceProfile

Signed-off-by: Simon Varlow <simon.varlow@d2l.com>

* Updated the unit test so all variables are at the top

Signed-off-by: Simon Varlow <simon.varlow@d2l.com>

* Fixed Rubocop issues that were detected

Signed-off-by: Simon Varlow <simon.varlow@d2l.com>

* Updating README.md to include changes to aws_ec2

Signed-off-by: Simon Varlow <simon.varlow@d2l.com>

* Add failing IT for has_roles?

Signed-off-by: Chris Redekop <chris.redekop@d2l.com>

* Add negative IT and fix uncovered issue

Signed-off-by: Chris Redekop <chris.redekop@d2l.com>

* Fix Rubocop issue

Signed-off-by: Chris Redekop <chris.redekop@d2l.com>

* Fix integration test

Signed-off-by: Chris Redekop <chris.redekop@d2l.com>

* Fix Rubocop issues and unit tests

Signed-off-by: Chris Redekop <chris.redekop@d2l.com>

* Pin AWS dependency to '~> 2'

Signed-off-by: Chris Redekop <chris.redekop@d2l.com>
2017-10-26 15:56:32 -04:00
Steffanie Freeman
1a31425e81 Issue #46 Lazily load attributes in aws_iam_users (#89)
* Initial Commit

Signed-off-by: sfreeman <Steffanie.Freeman@d2l.com>

* aws_iam_user uses lazy loading

Signed-off-by: sfreeman <Steffanie.Freeman@d2l.com>

* Disassociates convert call from list_users

Signed-off-by: sfreeman <Steffanie.Freeman@d2l.com>

* A real-world working AwsIamUsers (#71)

* Add aws_iam_users

Signed-off-by: Chris Redekop <chris.redekop@d2l.com>

* Adding Filter table and Collect User Details to aws_iam_users.rb

Signed-off-by: Chris Redekop <chris.redekop@d2l.com>

* Adding Filter table and Collect User Details to aws_iam_users.rb

Signed-off-by: Chris Redekop <chris.redekop@d2l.com>

* Adding Filter table and Collect User Details to aws_iam_users.rb

Signed-off-by: Chris Redekop <chris.redekop@d2l.com>

* Get an aws_iam_users integration test to pass

Signed-off-by: Chris Redekop <chris.redekop@d2l.com>

* Fix RuboCop issues and tests

Signed-off-by: Chris Redekop <chris.redekop@d2l.com>

* Improving code based on PR feedback

Signed-off-by: Chris Redekop <chris.redekop@d2l.com>

* AWS IAM Users unit tests work with new lazy loading feature

Signed-off-by: sfreeman <Steffanie.Freeman@d2l.com>

* Fixes tests

Signed-off-by: aduric <adnan.duric@d2l.com>

* Users should only hold the returned user references, transfering responsibility to each user to fetch any details

Signed-off-by: aduric <adnan.duric@d2l.com>

* Create user details provider class

Signed-off-by: sfreeman <Steffanie.Freeman@d2l.com>

* Using details provider factory to delegate creation of detail providers, and updates tests

Signed-off-by: aduric <adnan.duric@d2l.com>

* Rubocop fixes

Signed-off-by: aduric <adnan.duric@d2l.com>

* Rename user details provider factory to initializer, and remove unnecessary instance variables

Signed-off-by: sfreeman <Steffanie.Freeman@d2l.com>
2017-10-26 15:22:15 -04:00
Jerry Aldrich III
7b03361d03 Change aws_ec2 to aws_ec2_instance in examples (#97)
Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2017-10-17 14:38:49 +02:00
Jerry Aldrich III
11de78ee4a Correct examples in aws_iam_password_policy (#99)
Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2017-10-12 11:54:55 -04:00
Christoph Hartmann
d21e2af15f rename file for aws_ec2 resource
* rename to aws_ec2_instance

Signed-off-by: Christoph Hartmann <chris@lollyrock.com>
2017-10-11 16:18:20 -04:00
Clinton Wolfe
2f9317265b Update Terraform commands for v0.10 (#93)
* Terraform now requires init to fetch providers

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Rename env terraform command to workspace

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Pin Terraform version to reflect CLI updates

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2017-10-11 01:21:56 +01:00
Jerry Aldrich III
9bbb439467 Add support for ENV['AWS_REGION'] (#92)
The `aws-sdk` will raise an error mentioning `ENV['AWS_REGION']` if you
omit `ENV['AWS_DEFAULT_REGION']`. This adds support for either via `||`.

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2017-10-11 01:20:25 +01:00
Nathen Harvey
57578ab67d README code examples are copy-paste-able. (#86)
The resource is `aws_ec2`, not `ec2`

Instance IDs must be passed to the `aws_ec2` resource, not machine names

Signed-off-by: Nathen Harvey <nharvey@chef.io>
2017-10-08 14:27:42 +02:00
Jerry Aldrich III
0bce385836 Change ec2( to aws_ec2( in README.md (#87)
Signed-off-by: jerry <jerry@chef.io>
2017-09-05 12:40:01 -04:00
Christoph Hartmann
f8675c3559 update readme with available resources (#84)
Signed-off-by: Christoph Hartmann <chris@lollyrock.com>
2017-08-16 09:39:58 -04:00
Chris Redekop
c77d442007 Add has_mfa_enabled? to aws_iam_root_account (#80)
Signed-off-by: Chris Redekop <chris.redekop@d2l.com>
2017-08-16 11:53:44 +02:00
Chris Redekop
033bc13aa0 A real-world working AwsIamUsers (#71)
* Add aws_iam_users

Signed-off-by: Chris Redekop <chris.redekop@d2l.com>

* Adding Filter table and Collect User Details to aws_iam_users.rb

Signed-off-by: Chris Redekop <chris.redekop@d2l.com>

* Adding Filter table and Collect User Details to aws_iam_users.rb

Signed-off-by: Chris Redekop <chris.redekop@d2l.com>

* Adding Filter table and Collect User Details to aws_iam_users.rb

Signed-off-by: Chris Redekop <chris.redekop@d2l.com>

* Get an aws_iam_users integration test to pass

Signed-off-by: Chris Redekop <chris.redekop@d2l.com>

* Fix RuboCop issues and tests

Signed-off-by: Chris Redekop <chris.redekop@d2l.com>

* Improving code based on PR feedback

Signed-off-by: Chris Redekop <chris.redekop@d2l.com>
2017-08-08 15:50:35 +02:00
Steffanie Freeman
660ab99d98 Run linter on unit tests (#51)
* Run linter on unit tests

Signed-off-by: sfreeman <Steffanie.Freeman@d2l.com>

* Bring remaining unit tests up to spec with rubocop

Signed-off-by: sfreeman <Steffanie.Freeman@d2l.com>
2017-07-05 22:31:27 +02:00
Miles Tjandrawidjaja
798776cf50 Ensure resources are cleaned when running test:integration even if integration tests fail (#56)
Signed-off-by: Miles Tjandrawidjaja <miles@tjandrawidjaja.com>
2017-07-05 22:30:27 +02:00
Steffanie Freeman
29b4fbebe4 Add to_s method to aws_iam_password_policy (#61)
* Add to_s method to aws_iam_password_policy

Signed-off-by: sfreeman <Steffanie.Freeman@d2l.com>

* Use single quoted string and remove unnecessary substring

Signed-off-by: sfreeman <Steffanie.Freeman@d2l.com>
2017-06-29 03:03:20 -07:00
Miles Tjandrawidjaja
1a360cff8b Prompt for namespace if not set in environment variable instead of providing a random namespace (#57)
Signed-off-by: Miles Tjandrawidjaja <miles@tjandrawidjaja.com>
2017-06-28 05:55:01 -07:00
Steffanie Freeman
99baa9b2ab Add to_s method to aws_iam_user (#60)
Signed-off-by: sfreeman <Steffanie.Freeman@d2l.com>
2017-06-28 05:46:59 -07:00
Miles Tjandrawidjaja
a1dc5e981e [ISSUE-39] - Cover Recommendation 1.12 (#49)
* Adding resource aws_iam_root_user

Signed-off-by: Miles Tjandrawidjaja <miles@tjandrawidjaja.com>

* Adding to_s method to class aws_iam_root_user

Signed-off-by: Miles Tjandrawidjaja <miles@tjandrawidjaja.com>

* Cleaner to_s result for aws_iam_root_user

Signed-off-by: Miles Tjandrawidjaja <miles@tjandrawidjaja.com>
2017-06-13 07:44:11 +02:00
Miles Tjandrawidjaja
5c319ff056 [ISSUE-36] - Cover Recommendation 1.10 (#47)
* Add query for password_reuse_prevention to iam_password_policy

Signed-off-by: Miles Tjandrawidjaja <miles@tjandrawidjaja.com>

* Use mock over stub, and more concise language for tests in aws_iam_password_policy

Signed-off-by: Miles Tjandrawidjaja <miles@tjandrawidjaja.com>

* Rename method prevent_password_reuse to prevents_password_reuse

Signed-off-by: Miles Tjandrawidjaja <miles@tjandrawidjaja.com>
2017-06-13 07:41:43 +02:00
Chris Redekop
15459ca295 Add access_keys method to aws_iam_user (#44)
* Add access_keys method to aws_iam_user

Signed-off-by: Chris Redekop <chris.redekop@d2l.com>

* Fix unit test that accessed AWS

Signed-off-by: Chris Redekop <chris.redekop@d2l.com>

* Incorporate PR feedback

Signed-off-by: Chris Redekop <chris.redekop@d2l.com>

* Fix unit tests

Signed-off-by: Chris Redekop <chris.redekop@d2l.com>

* Update tests based on PR feedback

Signed-off-by: Chris Redekop <chris.redekop@d2l.com>

* Rebase to master

Signed-off-by: Chris Redekop <chris.redekop@d2l.com>
2017-06-13 07:36:43 +02:00
Christoph Hartmann
faa2840c1f update readme
Signed-off-by: Christoph Hartmann <chris@lollyrock.com>
2017-05-22 18:49:27 -05:00
Christoph Hartmann
1ec156962a Merge pull request #45 from chef/getusersfinalfinal
Add list_users
2017-05-22 18:32:32 -05:00
Christoph Hartmann
ab59dd4c3e Merge pull request #48 from chef/MinorCleanup
Remove Unneeded Require Statement
2017-05-22 18:29:57 -05:00
Christoph Hartmann
426a4af22e Merge pull request #35 from chef/issue24
[ISSUE-24] - Use terraform environment to avoid integration tests collisions
2017-05-22 18:27:52 -05:00
Miles Tjandrawidjaja
323a0e8064 Remove unneeded require statement
Signed-off-by: Miles Tjandrawidjaja <miles@tjandrawidjaja.com>
2017-05-13 21:40:13 -04:00
sfreeman
beedecf247 Add list_users
Signed-off-by: sfreeman <Steffanie.Freeman@d2l.com>
2017-05-10 15:41:03 -04:00
Miles
69434fec48 Use terraform environments to avoid integration test collisions
* When running integration tests with Rakefile use terraform environment based on environment variable INSPEC_TERRAFORM_ENV
** If INSPEC_TERRAFORM_ENV is not provided, a random string will be used
* Use terraform environment as a namespace for AWS artifacts
* Use attribute file for inspec to be aware of the terraform environment used

Signed-off-by: Miles Tjandrawidjaja <miles@tjandrawidjaja.com>
2017-05-06 14:14:53 -04:00
Christoph Hartmann
5581762c64 Merge pull request #33 from chef/issue25-b
Defensive programming for aws_iam_access_key
2017-05-05 16:20:03 +02:00
Chris Redekop
0ab4ae7d6e Update resource based on PR feedback
Signed-off-by: Chris Redekop <chris.redekop@d2l.com>
2017-05-02 14:54:57 +00:00
Chris Redekop
3f22a54aa6 Remove unnecessary test resource
Signed-off-by: Chris Redekop <chris.redekop@d2l.com>
2017-05-02 14:54:57 +00:00
Chris Redekop
37bcce6618 Add defensive programming
Signed-off-by: Chris Redekop <chris.redekop@d2l.com>
2017-05-02 14:54:57 +00:00
Christoph Hartmann
11905af32a Merge pull request #32 from chef/issue31
add password expiry and password expiry time to iam_password_policy
2017-05-02 11:23:44 +02:00
Christoph Hartmann
042b6550dd Merge pull request #30 from chef/Issue9-UserProvider
User provider refactor
2017-05-02 11:20:48 +02:00
Chris Redekop
891f075d13 Update resource based on PR feedback
Signed-off-by: Chris Redekop <chris.redekop@d2l.com>
2017-04-28 10:52:42 +00:00
Viktor Yakovlyev
19f752f778 add 1.11, password expiry and password expiry time in days, fix examples
Signed-off-by: Viktor Yakovlyev <Viktor.Y@D2L.com>

check for unset password expiry

Signed-off-by: Viktor Yakovlyev <Viktor.Y@D2L.com>

pr changes

Signed-off-by: Viktor Yakovlyev <Viktor.Y@D2L.com>
2017-04-28 10:52:42 +00:00
sfreeman
c43c863109 Added user provider
Signed-off-by: sfreeman <Steffanie.Freeman@d2l.com>
2017-04-27 16:17:43 -04:00
Christoph Hartmann
bbe60c9614 Merge pull request #28 from chef/issue25
Add a new access-key resource
2017-04-18 15:12:06 +02:00
Chris Redekop
915e2fd7c6 Updates based on PR feedback
Signed-off-by: Chris Redekop <chris.redekop@d2l.com>
2017-04-18 15:03:31 +02:00
Chris Redekop
3cdb639a0c Uncomment unit tests
Signed-off-by: Chris Redekop <chris.redekop@d2l.com>
2017-04-18 15:03:31 +02:00
Chris Redekop
fcb8d17feb Incorporate PR feedback
Signed-off-by: Chris Redekop <chris.redekop@d2l.com>
2017-04-18 15:03:31 +02:00
Chris Redekop
44e15b85f9 Update usage example
Signed-off-by: Chris Redekop <chris.redekop@d2l.com>
2017-04-18 15:03:31 +02:00
Chris Redekop
e0dfbad730 Fix Rubocop issue
Signed-off-by: Chris Redekop <chris.redekop@d2l.com>
2017-04-18 15:03:31 +02:00
Chris Redekop
d428a96bab Add a new access-key resource
Signed-off-by: Chris Redekop <chris.redekop@d2l.com>
2017-04-18 15:03:31 +02:00