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

[BUG] With version 2.3.0 of the provider, the ressource opensearch_channel_configuration cannot be applied when assuming an iam role in the provider #200

Closed
Jaewongtongsoup opened this issue Jun 20, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@Jaewongtongsoup
Copy link

Jaewongtongsoup commented Jun 20, 2024

What is the bug?

With version 2.3.0 of the provider, the ressource opensearch_channel_configuration cannot be applied when assuming an iam role in the provider like so :
image
image

Do you have any screenshots?

image
provider.terraform-provider-opensearch_v2.3.0: Response contains error diagnostic: diagnostic_severity=ERROR tf_proto_version=5.4 tf_provider_addr=provider tf_resource_type=opensearch_channel_configuration @module=sdk.proto diagnostic_detail= tf_rpc=ApplyResourceChange @caller=github.com/hashicorp/[email protected]/tfprotov5/internal/diag/diagnostics.go:58 diagnostic_summary="HTTP 403 Forbidden: Permission denied. Please ensure that the correct credentials are being used to access the cluster." tf_req_id=4c4f9019-ad7d-e488-f5e9-008d96464823 timestamp=2024-06-20T17:46:03.247Z

It works perfectly when I force version 2.2.0 of the provider.

Other ressources that also uses this provider configs with version 2.3.0 doesnt seems to be affected and works perfectly like :
image

@Jaewongtongsoup Jaewongtongsoup added bug Something isn't working untriaged labels Jun 20, 2024
@rblcoder
Copy link
Collaborator

The following terraform code works for me

terraform {
  required_providers {
    opensearch = {
      source = "opensearch-project/opensearch"
      version = "2.3.0"
    }
  }
}

provider "opensearch" {
  url = "url"
  healthcheck        = "false"
  aws_region          = "region"
  aws_assume_role_arn = "assume role arn"
  aws_assume_role_external_id = "external id"
  version_ping_timeout = "10"

}

resource "opensearch_index" "index" {
  name = "sample"
  number_of_replicas = "1"
  number_of_shards = "1"
  
}

resource "opensearch_channel_configuration" "webhook_channel_configuration" {
  body = <<EOF
{
  "id": "sample-webhook-id",
  "name": "sample-name",
  "config": {
    "name": "Sample Webhook Channel",
    "description": "Sample webhook description",
    "config_type": "webhook",
    "is_enabled": true,
    "webhook": {
      "url": "https://www.example.com"
    }
  }
}
EOF
}

@Jaewongtongsoup
Copy link
Author

Can you try using an AWS SNS channel instead of a webhook?

@rblcoder
Copy link
Collaborator

The following works for me

terraform {
  required_providers {
    opensearch = {
      source = "opensearch-project/opensearch"
      version = "2.3.0"
    }
  }
}

provider "opensearch" {
  url = "url"
  healthcheck        = "false"
  aws_region          = "region"
  aws_assume_role_arn = "role arn"
  aws_assume_role_external_id = "opensearch-external"
  version_ping_timeout = "10"

}

resource "opensearch_index" "index" {
  name = "sample"
  number_of_replicas = "1"
  number_of_shards = "1"
  
}

resource "opensearch_channel_configuration" "sns_channel_configuration" {
  body = <<EOF
{
  "id": "sample-sns-id",
  "name": "sample-name",
  "config": {
      "name": "sns-channel",  
      "config_type": "sns",  
        "sns": {  
          "topic_arn": "topic arn",  
          "role_arn": "role arn"  
        } 

      }
}
EOF
}

@prudhvigodithi
Copy link
Member

Thanks @rblcoder, closing this issue @Jaewongtongsoup please feel-free to re-open if required.

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
Status: ✅ Done
Development

No branches or pull requests

3 participants