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

Creating an ec_snapshot_repository fails with message "The requested resource could not be found." #885

Open
xvitcoder opened this issue Jan 28, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@xvitcoder
Copy link

xvitcoder commented Jan 28, 2025

Elastic EC provider version: 0.12.2

I have an ec_deployment up and running, created by terraform

but adding the ec_snapshot_repository with the following config, it fails

Snapshot Repository terraform code:

resource "ec_snapshot_repository" "repository" {
  name = "test-repo"
  s3 = {
    access_key             = "testkey"
    secret_key             = "secretkey"
    bucket                 = "test-bucket"
    region                 = "eu-west-1"
    server_side_encryption = true
  }
}

When applying, I get this the following plan:

  # module.elasticcloud.ec_snapshot_repository.repository will be created
  + resource "ec_snapshot_repository" "repository" {
      + id   = (known after apply)
      + name = "test-repo"
      + s3   = {
          + access_key             = "testkey"
          + bucket                   = "test-bucket"
          + path_style_access  = false
          + region                    = "eu-west-1"
          + secret_key             = (sensitive value)
          + server_side_encryption = true
        }
    }

when applying it, I get the following error:

module.elasticcloud.ec_snapshot_repository.repository: Creating...

│ Error: {"ok":false,"message":"The requested resource could not be found."}
│ 
│   with module.elasticcloud.ec_snapshot_repository.repository,
│   on ../modules/elastic-cloud-deployment/main.tf line 33, in resource "ec_snapshot_repository" "repository":
│   33: resource "ec_snapshot_repository" "repository" {
│ 
│ {"ok":false,"message":"The requested resource could not be found."}

I tried to use the generic config (the role_arn was edited):

resource "ec_snapshot_repository" "repository" {
  name = "test-repo"
  generic = {
    type = "s3"
    settings = jsonencode({
      client                 = "test"
      bucket                 = "test-bucket"
      base_path              = "somepath"
      region                 = "eu-west-1"
      role_arn               = "arn:aws:iam::XXXXXXXXXXX:role/my-role"
      compress               = "true"
      server_side_encryption = "true"
    })
  }
}

For the above terraform code I get the following plan (the role_arn was edited):

# module.elasticcloud.ec_snapshot_repository.repository will be created
  + resource "ec_snapshot_repository" "repository" {
      + generic = {
          + settings = jsonencode(
                {
                  + base_path              = "somepath"
                  + bucket                 = "test-bucket"
                  + client                 = "test"
                  + compress               = "true"
                  + region                 = "eu-west-1"
                  + role_arn               = "arn:aws:iam::XXXXXXXXXXX:role/my-role"
                  + server_side_encryption = "true"
                }
            )
          + type     = "s3"
        }
      + id      = (known after apply)
      + name    = "test-repo"
    }

For the generic config I have also created the ec_deployment_elasticsearch_keystore for both s3.client.test.access_key and s3.client.test.secret_key, which have been created successfully.

But the generic config still throws the exact same error

module.elasticcloud.ec_snapshot_repository.repository: Creating...

│ Error: {"ok":false,"message":"The requested resource could not be found."}
│ 
│   with module.elasticcloud.ec_snapshot_repository.repository,
│   on ../modules/elastic-cloud-deployment/main.tf line 33, in resource "ec_snapshot_repository" "repository":
│   33: resource "ec_snapshot_repository" "repository" {
│ 
│ {"ok":false,"message":"The requested resource could not be found."}
@xvitcoder xvitcoder added the bug Something isn't working label Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant