phillbaker / terraform-provider-elasticsearch

An elasticsearch provider for terraform
https://registry.terraform.io/providers/phillbaker/elasticsearch
Mozilla Public License 2.0
303 stars 133 forks source link

Please add the parameter to pass in a session name when assuming a role in AWS #332

Closed antonisnyc94 closed 1 year ago

antonisnyc94 commented 1 year ago

Please add a parameter to also define the session name you want to pass in with the role you assume for the ES cluster.

phillbaker commented 1 year ago

Hello, please include an example of how this would be used in the terraform provider configuration block and links to any documentation describing how this would work with the underlying AWS authentication.

Please submit a pull request contributing this if you'd like!

antonisnyc94 commented 1 year ago
provider "elasticsearch" {
    url                 = "https://search-foo-bar-pqrhr4w3u4dzervg41frow4mmy.us-east-1.es.amazonaws.com"
    aws_assume_role_arn = "arn:aws:iam::012345678901:role/rolename"
    aws_session_name      = "definedname"
}

I think you need to add the parameter under this function func assumeRoleCredentials in provider.go.

It should be relatively easy and thank you for your help! Unfortunately 1) i never contributed to know how to do it and 2) dont know how to test a provider locally for now.

Thanks, Tony

phillbaker commented 1 year ago

I haven't been able to test this, but please try the provider on master if you can and let me know if you have issues.