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

Add cloudwatch.PutMetricAlarmInput possibility to choose region #2650

Closed
2 tasks
Redeltaz opened this issue May 22, 2024 · 2 comments
Closed
2 tasks

Add cloudwatch.PutMetricAlarmInput possibility to choose region #2650

Redeltaz opened this issue May 22, 2024 · 2 comments
Assignees
Labels
feature-request A feature should be added or improved.

Comments

@Redeltaz
Copy link

Redeltaz commented May 22, 2024

Describe the feature

Add the possibility, when creating a new alarm with cloudwatch.PutMetricAlarmInput, to add the region where you want this alarm to be created in.

Use Case

This idea mainly come from a problem that I encounter on the Terraform Provider for AWS, more specifically this issue where I discover that when all your work is in a specific region, but you want to create a cloudwatch alarm for billing for example, which is possible only in us-east-1 region, you just can't or you're forced to try specifics tricks to resolve a problem that can be simply solved by adding a parameter

Proposed Solution

While creating a new Cloudwatch alarm with the c.PutMetricAlarm, the function need a cloudwatch.PutMetricAlarmInput input params wich has multiple fields like AlarmName, AlarmDescription... I think it's here where we will need to add a Region parameter. I try to understand how the requests work after that, but I don't know for the moment if the call to the API when you add Region is simple or if there is other stuffs to update too.

Other Information

I also discover that this problem also affect other resources like lambda or other resources wich take the region selected by default on the console when created manually. So I don't know if a feature like that is doable, or if it's just impossible because of the way AWS is built.

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

AWS Go SDK V2 Module Versions Used

v1.27.15

Go version used

go 1.22.2

@Redeltaz Redeltaz added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels May 22, 2024
@RanVaknin
Copy link
Contributor

Hi @Redeltaz ,

This is not possible for a few reasons:

  1. The AWS SDKs are all code-generated from the API models of each service. In this case, the Cloudwatch API team is the only one that can make changes to the API model to introduce new parameters, this is not actionable by the SDK team.

  2. The way the AWS server determines which region a resource will be created in is based on which AWS partition the request is being sent to. The SDK client is initialized in a specific region, and the SDKs routing rules will build the request URL based on the region provided in the client's config. Even if a service team has provided a parameter, there wouldn't be an API-operation-specific way to override the endpoint rules that the SDK client currently uses to build requests.

Even though Terraform folks interact with us regularly, I'm not super familiar with Terraform provider as a product (since AWS has its own product, CDK, that we use instead), but since its based on the Go SDK and based on what I've read on #28971, the correct, and only way is to create a provider for each region you are using.

Thanks,
Ran~

@RanVaknin RanVaknin self-assigned this May 23, 2024
@RanVaknin RanVaknin removed the needs-triage This issue or PR still needs to be triaged. label May 23, 2024
@RanVaknin RanVaknin closed this as not planned Won't fix, can't repro, duplicate, stale May 23, 2024
Copy link

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved.
Projects
None yet
Development

No branches or pull requests

2 participants