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

Amazon CloudFront additional real-time metrics in Amazon CloudWatch #11577

Closed
piyushsonigra opened this issue Jan 13, 2020 · 10 comments · Fixed by #18083
Closed

Amazon CloudFront additional real-time metrics in Amazon CloudWatch #11577

piyushsonigra opened this issue Jan 13, 2020 · 10 comments · Fixed by #18083
Labels
enhancement Requests to existing resources that expand the functionality or scope. new-resource Introduces a new resource. service/cloudfront Issues and PRs that pertain to the cloudfront service.

Comments

@piyushsonigra
Copy link

piyushsonigra commented Jan 13, 2020

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 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
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

AWS recently released feature in CloudFront to view additional cloudwatch metrics.

New or Affected Resource(s)

aws_cloudfront_distribution

Potential Terraform Configuration

terraform "aws_cloudfront_distribution" "cf_name" {
   ....
   additional_metrics = true
   ....
}

References

https://aws.amazon.com/about-aws/whats-new/2019/12/cloudfront-realtime-metrics/
https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/viewing-cloudfront-metrics.html#monitoring-console.distributions-additional

@piyushsonigra piyushsonigra added the enhancement Requests to existing resources that expand the functionality or scope. label Jan 13, 2020
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Jan 13, 2020
@asaghri
Copy link

asaghri commented Apr 17, 2020

Hi, any update on this ? This feature will be greatly appreciated !

@jpeeler
Copy link

jpeeler commented May 1, 2020

I was looking for this as well, but wasn't able to find the functionality implemented in https://github.com/aws/aws-sdk-go. Did I miss it? If not, it's doubtful this can move forward until the SDK supports it.

@r1m
Copy link

r1m commented May 13, 2020

Apparently the console is using an undocumented API method (UpdateMonitoringSubscription) that is not public yet and not part of any SDK I checked. AWS support confirmed to me that it is not possible yet through SDK.
image

@anmolbhatia05
Copy link

@piyushsonigra Is there a way to enable real time metrics via terraform now ?

@vicentllongo
Copy link

The functionality to manage additional and real-time metrics is already available in the aws-sdk-go since v1.34.13:

You can now manage CloudFront's additional, real-time metrics with the CloudFront API.

@piyushsonigra
Copy link
Author

piyushsonigra commented Sep 24, 2020

@anmolbhatia05 directly inside terraform resource, it's not available yet but you can enable additional metrics using null_resource and local-exec Provisioner and execute AWS cli command.

resource "aws_cloudfront_distribution" "distribution" {
  ....
  ....
}

resource "null_resource" "cloudfront_addtional_metrics" {

 provisioner "local-exec" {
   command = "aws --profile $aws_profile cloudfront create-monitoring-subscription --distribution-id $cloudfront_distribution_id --monitoring-subscription RealtimeMetricsSubscriptionConfig={RealtimeMetricsSubscriptionStatus=Enabled}"

   environment = {
      aws_profile = var.aws_profile
      cloudfront_distribution_id = aws_cloudfront_distribution.distribution.id
    }
  }
}

@ewbankkit ewbankkit added service/cloudfront Issues and PRs that pertain to the cloudfront service. and removed needs-triage Waiting for first response or review from a maintainer. labels Dec 21, 2020
@ewbankkit ewbankkit added the new-resource Introduces a new resource. label Feb 12, 2021
@ewbankkit
Copy link
Contributor

Potential new resource:

resource "aws_cloudfront_monitoring_subscription" "example" {
  distribution_id = aws_cloudfront_distribution.example.id

  monitoring_subscription {
    realtime_metrics_subscription_config {
      realtime_metrics_subscription_status = "Enabled"
    }
  }
}

@shuheiktgw
Copy link
Collaborator

I've started implementing this resource

@shuheiktgw
Copy link
Collaborator

shuheiktgw commented Mar 14, 2021

I added the resource in #18083 and it's now ready for review. Please upvote the PR for faster review! 🙏

@github-actions
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 Jul 31, 2021
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. new-resource Introduces a new resource. service/cloudfront Issues and PRs that pertain to the cloudfront service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants