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

Unable to create forwarder module in regions other than us-east-1 #1

Open
qpre opened this issue Dec 16, 2024 · 3 comments
Open

Unable to create forwarder module in regions other than us-east-1 #1

qpre opened this issue Dec 16, 2024 · 3 comments

Comments

@qpre
Copy link

qpre commented Dec 16, 2024

when trying to use the module using aws provider with regions like eu-west-3 the zip for the lambda is not reachable.

InvalidParameterValueException: Error occurred while GetObject. S3 Error Code: PermanentRedirect. S3 Error Message: The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.

as I'm guessing the lambda from us-east-1 won't forward logs from CW groups in eu-west-3, is there a way to circumvent this ?could the lambda zip directory be shipped with the module ?

@dasfmi
Copy link
Collaborator

dasfmi commented Dec 17, 2024

hi @qpre. I will try to reproduce, the zip file should be accessible from anywhere, will double check.

As for your question, yes forwarder lambda have to be in the same region as the CW groups.

@dasfmi
Copy link
Collaborator

dasfmi commented Dec 17, 2024

I tried to access the zip file from the browser and it works, so I doubt thats the issue. Can you show an example code of your module?

@qpre
Copy link
Author

qpre commented Dec 17, 2024

Hey, thanks for your answer

I tried to access the zip file from the browser and it works, so I doubt thats the issue.

it's normal that it works in a browser because you already have an url for the asset, what does not work is here:

resource "aws_lambda_function" "forwarder" {
  s3_bucket     = var.lambda_zip_bucket
  s3_key        = "axiom-cloudwatch-forwarder/v${var.lambda_zip_version}/forwarder.zip"
  ...
}

when deploying a lambda with an s3 asset, the asset must be in the same region as where the lambda is deployed.

Can you show an example code of your module?

module "axiom-cloudwatch-forwarder" {
  source           = "axiomhq/axiom-cloudwatch-forwarder/aws//modules/forwarder"
  axiom_dataset    = axiom_dataset.cloudwatch.name
  axiom_token      = axiom_token.cloudwatch.token
  prefix           = "forwarder-${var.environment}"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants