terraform-provider-http icon indicating copy to clipboard operation
terraform-provider-http copied to clipboard

Feature: Add HTTPS Resource Request

Open srikanth2302 opened this issue 1 year ago • 6 comments

Terraform CLI and Provider Versions

Terraform CLI Version: v1.3.6 Provider Version: 3.4.0

Use Cases or Problem Statement

I Would like to have a http resource request so that terraform can perform the Post Operation only if Attributes of the resource changed. DataSource is continuously performing POST Request which is not required.

Proposal

Something like below `

resource "http" "Post_Request" {
  name         = "vault-mount"
  url          = "https://localhost:8200/v1/sys/mounts/"
  method       = "POST"
  request_body = <<EOF
{
  "type": "aws",
  "config": {
    "force_no_cache": true
  }
}

EOF

  headers = {
    X-Vault-Token = "xxx"
  }
}

How much impact is this issue causing?

High

Additional Information

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

srikanth2302 avatar Jul 24 '23 14:07 srikanth2302

Hi @srikanth2302 👋

Thank you for raising this issue. We will leave this issue open and prioritise looking into this further on the basis of the level of community interest that is expressed.

Related: #241

bendbennett avatar Jul 25 '23 09:07 bendbennett

Hi @bendbennett

I think this would be a good feature

Terraform CLI and Provider Versions

Terraform CLI Version: v1.3.6 Provider Version: 3.4.0

Use Cases or Problem Statement

I Would like to have a http resource request so that terraform can perform the Post Operation only if Attributes of the resource changed. DataSource is continuously performing POST Request which is not required.

Proposal

Something like below `

resource "http" "Post_Request" {
  name         = "vault-mount"
  url          = "https://localhost:8200/v1/sys/mounts/"
  method       = "POST"
  request_body = <<EOF
{
  "type": "aws",
  "config": {
    "force_no_cache": true
  }
}

EOF

  headers = {
    X-Vault-Token = "xxx"
  }
}

How much impact is this issue causing?

High

Additional Information

No response

Code of Conduct

  • [x] I agree to follow this project's Code of Conduct

Hi @bendbennett,

It would be good to have this as a resource. Can you please prioritize this enhancement.

ShubhamKumar977 avatar Aug 02 '23 17:08 ShubhamKumar977

Hi @ShubhamKumar977 👋

Could you signal your interest in this issue by adding a 👍 to https://github.com/hashicorp/terraform-provider-http/issues/300#issue-1818585213. Thanks!

bendbennett avatar Aug 03 '23 06:08 bendbennett

Hi @bendbennett

This seems to be a reasonable request, I also have a use case not to execute data source, and having a resource would suit the requirement that we are trying to achieve... Can you prioritize this enhancement?

varshith1212 avatar Aug 03 '23 10:08 varshith1212

@bendbennett -- Any Update on this request?

srikanth2302 avatar Sep 04 '23 04:09 srikanth2302