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

[Enhancement]: Update aws_oam_link to support resource filtering for log groups and metric namespaces #37515

Closed
kieran-lowe opened this issue May 14, 2024 · 6 comments · Fixed by #38277
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/oam Issues and PRs that pertain to the oam service.
Milestone

Comments

@kieran-lowe
Copy link
Contributor

kieran-lowe commented May 14, 2024

Description

As of May 1st 2024, CloudWatch supports resource filtering to allow source accounts to only share a subset of metrics/logs with other accounts. It seems the API has been updated to allow configuring this via the CLI as --link-configuration and the API as LinkConfiguration.

Implementing this would allow source accounts to better control what metrics/logs are sent instead of all of them.

Affected Resource(s) and/or Data Source(s)

  • aws_oam_link

Potential Terraform Configuration

resource "aws_oam_link" "example" {
  label_template  = "$AccountName"
  resource_types  = ["AWS::CloudWatch::Metric", "AWS::Logs::LogGroup"]
  sink_identifier = aws_oam_sink.test.id
  tags = {
    Env = "prod"
  }

  link_configuration {
    log_group_configuration {
      filter = "LogGroupName IN ('This-Log-Group', 'Other-Log-Group')"
    }

    metric_configuration {
      filter = "Namespace IN ('AWS/EC2', 'AWS/ELB', 'AWS/S3')"
    }
  }
}

References

Would you like to implement a fix?

No

@kieran-lowe kieran-lowe added the enhancement Requests to existing resources that expand the functionality or scope. label May 14, 2024
Copy link

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added the service/oam Issues and PRs that pertain to the oam service. label May 14, 2024
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label May 14, 2024
@justinretzolk justinretzolk removed the needs-triage Waiting for first response or review from a maintainer. label May 24, 2024
Copy link

github-actions bot commented Jul 8, 2024

Warning

This issue has been closed, meaning that any additional comments are hard for our team to see. Please assume that the maintainers will not see them.

Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed.

@github-actions github-actions bot added this to the v5.58.0 milestone Jul 8, 2024
@sp055201
Copy link

acwwat ewbankkit

resource "aws_oam_link" "source_link" {
provider = aws.source
sink_identifier = aws_oam_sink.central_logging_sink.id
label_template = var.account_label
resource_types = var.allowed_resource_types
depends_on = [aws_oam_sink_policy.central_logging_sink_policy]
link_configuration {
log_group_configuration {
filter = "LogGroupName LIKE '/aws/rds/%'"
}
metric_configuration {
filter = "Namespace = 'AWS/RDS'"
}
}
}

Getting error for link configuration.


│ Error: Unsupported block type

│ on modules/central-logging/main.tf line 33, in resource "aws_oam_link" "source_link":
│ 33: link_configuration {

│ Blocks of type "link_configuration" are not expected here.

@kieran-lowe
Copy link
Contributor Author

acwwat ewbankkit

resource "aws_oam_link" "source_link" {

provider = aws.source

sink_identifier = aws_oam_sink.central_logging_sink.id

label_template = var.account_label

resource_types = var.allowed_resource_types

depends_on = [aws_oam_sink_policy.central_logging_sink_policy]

link_configuration {

log_group_configuration {

  filter = "LogGroupName LIKE '/aws/rds/%'"

}

metric_configuration {

  filter = "Namespace = 'AWS/RDS'"

}

}

}

Getting error for link configuration.

│ Error: Unsupported block type

│ on modules/central-logging/main.tf line 33, in resource "aws_oam_link" "source_link":

│ 33: link_configuration {

│ Blocks of type "link_configuration" are not expected here.

I don't think the v5.58 version of the provider has been released yet.

Copy link

This functionality has been released in v5.58.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. Thank you!

Copy link

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/oam Issues and PRs that pertain to the oam service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants