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

New Resource: aws_config_organization_config_rule #9299

Closed
mwarkentin opened this issue Jul 10, 2019 · 5 comments · Fixed by #9716
Closed

New Resource: aws_config_organization_config_rule #9299

mwarkentin opened this issue Jul 10, 2019 · 5 comments · Fixed by #9716
Assignees
Labels
new-resource Introduces a new resource. service/configservice Issues and PRs that pertain to the configservice service.
Milestone

Comments

@mwarkentin
Copy link
Contributor

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

AWS just added support for organization level config rules - it would be nice to be able to manage programatically in terraform:

New or Affected Resource(s)

  • aws_config_organization_config_rule

Potential Terraform Configuration

There are two types of rules - managed and custom. I'm not really sure how the resource should be configured for each (or if there should be two separate resources). It looks like the request shape is different than they used for single-account config rules:

{
   "ExcludedAccounts": [ "string" ],
   "OrganizationConfigRuleName": "string",
   "OrganizationCustomRuleMetadata": { 
      "Description": "string",
      "InputParameters": "string",
      "LambdaFunctionArn": "string",
      "MaximumExecutionFrequency": "string",
      "OrganizationConfigRuleTriggerTypes": [ "string" ],
      "ResourceIdScope": "string",
      "ResourceTypesScope": [ "string" ],
      "TagKeyScope": "string",
      "TagValueScope": "string"
   },
   "OrganizationManagedRuleMetadata": { 
      "Description": "string",
      "InputParameters": "string",
      "MaximumExecutionFrequency": "string",
      "ResourceIdScope": "string",
      "ResourceTypesScope": [ "string" ],
      "RuleIdentifier": "string",
      "TagKeyScope": "string",
      "TagValueScope": "string"
   }
}

vs original config rule:

{
   "ConfigRule": { 
      "ConfigRuleArn": "string",
      "ConfigRuleId": "string",
      "ConfigRuleName": "string",
      "ConfigRuleState": "string",
      "CreatedBy": "string",
      "Description": "string",
      "InputParameters": "string",
      "MaximumExecutionFrequency": "string",
      "Scope": { 
         "ComplianceResourceId": "string",
         "ComplianceResourceTypes": [ "string" ],
         "TagKey": "string",
         "TagValue": "string"
      },
      "Source": { 
         "Owner": "string",
         "SourceDetails": [ 
            { 
               "EventSource": "string",
               "MaximumExecutionFrequency": "string",
               "MessageType": "string"
            }
         ],
         "SourceIdentifier": "string"
      }
   },
   "Tags": [ 
      { 
         "Key": "string",
         "Value": "string"
      }
   ]
}

References

@mwarkentin mwarkentin added the enhancement Requests to existing resources that expand the functionality or scope. label Jul 10, 2019
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Jul 10, 2019
@bflad bflad added new-resource Introduces a new resource. service/configservice Issues and PRs that pertain to the configservice service. and removed enhancement Requests to existing resources that expand the functionality or scope. needs-triage Waiting for first response or review from a maintainer. labels Jul 10, 2019
@bflad bflad self-assigned this Aug 9, 2019
@bflad
Copy link
Contributor

bflad commented Aug 9, 2019

Hi folks 👋 The team at HashiCorp is picking this feature request up for implementation and we can provide an update about this later today or Monday. 👍

@bflad bflad added this to the v2.24.0 milestone Aug 9, 2019
bflad added a commit that referenced this issue Aug 10, 2019
…anization_managed_rule

Reference: #9299

Output from acceptance testing:

```
    --- PASS: TestAccAWSConfig/OrganizationCustomRule (3029.15s)
        --- PASS: TestAccAWSConfig/OrganizationCustomRule/InputParameters (305.03s)
        --- PASS: TestAccAWSConfig/OrganizationCustomRule/MaximumExecutionFrequency (232.54s)
        --- PASS: TestAccAWSConfig/OrganizationCustomRule/ResourceIdScope (226.23s)
        --- PASS: TestAccAWSConfig/OrganizationCustomRule/ResourceTypesScope (282.06s)
        --- PASS: TestAccAWSConfig/OrganizationCustomRule/basic (130.37s)
        --- PASS: TestAccAWSConfig/OrganizationCustomRule/disappears (141.50s)
        --- PASS: TestAccAWSConfig/OrganizationCustomRule/errorHandling (155.78s)
        --- PASS: TestAccAWSConfig/OrganizationCustomRule/ExcludedAccounts (246.06s)
        --- PASS: TestAccAWSConfig/OrganizationCustomRule/TagValueScope (255.75s)
        --- PASS: TestAccAWSConfig/OrganizationCustomRule/TriggerTypes (258.28s)
        --- PASS: TestAccAWSConfig/OrganizationCustomRule/Description (271.57s)
        --- PASS: TestAccAWSConfig/OrganizationCustomRule/LambdaFunctionArn (231.53s)
        --- PASS: TestAccAWSConfig/OrganizationCustomRule/TagKeyScope (292.43s)
    --- PASS: TestAccAWSConfig/OrganizationManagedRule (2809.33s)
        --- PASS: TestAccAWSConfig/OrganizationManagedRule/RuleIdentifier (254.75s)
        --- PASS: TestAccAWSConfig/OrganizationManagedRule/TagKeyScope (301.58s)
        --- PASS: TestAccAWSConfig/OrganizationManagedRule/Description (238.37s)
        --- PASS: TestAccAWSConfig/OrganizationManagedRule/ExcludedAccounts (300.45s)
        --- PASS: TestAccAWSConfig/OrganizationManagedRule/MaximumExecutionFrequency (234.66s)
        --- PASS: TestAccAWSConfig/OrganizationManagedRule/ResourceTypesScope (261.44s)
        --- PASS: TestAccAWSConfig/OrganizationManagedRule/ResourceIdScope (285.29s)
        --- PASS: TestAccAWSConfig/OrganizationManagedRule/TagValueScope (263.19s)
        --- PASS: TestAccAWSConfig/OrganizationManagedRule/basic (115.53s)
        --- PASS: TestAccAWSConfig/OrganizationManagedRule/disappears (176.75s)
        --- PASS: TestAccAWSConfig/OrganizationManagedRule/errorHandling (150.24s)
        --- PASS: TestAccAWSConfig/OrganizationManagedRule/InputParameters (227.08s)
```
@bflad
Copy link
Contributor

bflad commented Aug 10, 2019

Pull request submitted: #9716

bflad added a commit that referenced this issue Aug 12, 2019
…anization_managed_rule

Reference: #9299

Output from acceptance testing:

```
    --- PASS: TestAccAWSConfig/OrganizationCustomRule (3029.15s)
        --- PASS: TestAccAWSConfig/OrganizationCustomRule/InputParameters (305.03s)
        --- PASS: TestAccAWSConfig/OrganizationCustomRule/MaximumExecutionFrequency (232.54s)
        --- PASS: TestAccAWSConfig/OrganizationCustomRule/ResourceIdScope (226.23s)
        --- PASS: TestAccAWSConfig/OrganizationCustomRule/ResourceTypesScope (282.06s)
        --- PASS: TestAccAWSConfig/OrganizationCustomRule/basic (130.37s)
        --- PASS: TestAccAWSConfig/OrganizationCustomRule/disappears (141.50s)
        --- PASS: TestAccAWSConfig/OrganizationCustomRule/errorHandling (155.78s)
        --- PASS: TestAccAWSConfig/OrganizationCustomRule/ExcludedAccounts (246.06s)
        --- PASS: TestAccAWSConfig/OrganizationCustomRule/TagValueScope (255.75s)
        --- PASS: TestAccAWSConfig/OrganizationCustomRule/TriggerTypes (258.28s)
        --- PASS: TestAccAWSConfig/OrganizationCustomRule/Description (271.57s)
        --- PASS: TestAccAWSConfig/OrganizationCustomRule/LambdaFunctionArn (231.53s)
        --- PASS: TestAccAWSConfig/OrganizationCustomRule/TagKeyScope (292.43s)
    --- PASS: TestAccAWSConfig/OrganizationManagedRule (2809.33s)
        --- PASS: TestAccAWSConfig/OrganizationManagedRule/RuleIdentifier (254.75s)
        --- PASS: TestAccAWSConfig/OrganizationManagedRule/TagKeyScope (301.58s)
        --- PASS: TestAccAWSConfig/OrganizationManagedRule/Description (238.37s)
        --- PASS: TestAccAWSConfig/OrganizationManagedRule/ExcludedAccounts (300.45s)
        --- PASS: TestAccAWSConfig/OrganizationManagedRule/MaximumExecutionFrequency (234.66s)
        --- PASS: TestAccAWSConfig/OrganizationManagedRule/ResourceTypesScope (261.44s)
        --- PASS: TestAccAWSConfig/OrganizationManagedRule/ResourceIdScope (285.29s)
        --- PASS: TestAccAWSConfig/OrganizationManagedRule/TagValueScope (263.19s)
        --- PASS: TestAccAWSConfig/OrganizationManagedRule/basic (115.53s)
        --- PASS: TestAccAWSConfig/OrganizationManagedRule/disappears (176.75s)
        --- PASS: TestAccAWSConfig/OrganizationManagedRule/errorHandling (150.24s)
        --- PASS: TestAccAWSConfig/OrganizationManagedRule/InputParameters (227.08s)
```
@bflad
Copy link
Contributor

bflad commented Aug 12, 2019

Two new resources to manage these rules have been merged:

  • New Resource: aws_config_organization_custom_rule
  • New Resource: aws_config_organization_managed_rule

They will release with version 2.24.0 of the Terraform AWS Provider, later this week.

@ghost
Copy link

ghost commented Aug 15, 2019

This has been released in version 2.24.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Nov 1, 2019

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Nov 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
new-resource Introduces a new resource. service/configservice Issues and PRs that pertain to the configservice service.
Projects
None yet
2 participants