feat: restructure and add new datadog integration policies #69
+270
−141
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why
What
join("", resource.kind.*.name)
andresource.kind[0].name
toone(resource.kind[*].name)
var.integrations
and addvar.policies
in its placevar.policies
local.policies
which is the list of policies specified viavar.integrations
andvar.policies
combined with mappings and then de-duplicatedNote
For compatibility, map
var.integrations
"core" -> "core_integration" and "all" -> "full_integration" when adding tolocal.policies
.iam_policy_all.tf
->iam-policy-full-integration.tf
and rename all the resources etc. named "all" to "full_integration", and trigger it with policy name "full-integration"statement.actions
) from those sources:full-integration permissions
iam_policy_core.tf
->iam-policy-core-integration.tf
and rename all the resources etc. named "core" to "core_integration", and trigger it with policy name "core-integration"statement.actions
) by removing 'support:*'iam-policy-resource-collection.tf
iam-policy-full-integration.tf
and createiam-policy-resource-collection.tf
to implement theresource-collection
option, referencing and using the policy from https://docs.datadoghq.com/integrations/amazon_web_services/?tab=roledelegation#aws-resource-collection-iam-policy-1resource-collection permissions
iam-policy-security-audit.tf