CheckPointSW / terraform-provider-checkpoint

Terraform provider for Check Point
https://www.terraform.io/docs/providers/checkpoint/
Mozilla Public License 2.0
28 stars 40 forks source link

Update resource_checkpoint_management_aws_data_center_server.go #143

Closed bmyers-dev closed 1 year ago

bmyers-dev commented 1 year ago

Fixes #142

@chkp-royl - ran into a minor issue with the AWS Data Center server object today when trying to use sts-external-id.

Issue with "custom-value" being built into AWS Data Center server object instead of "sts-external-id" like the update statement has.

chkp-royl commented 1 year ago

Seems like bug. Thanks @bmyers-dev for this fix! Did you run test to verify it's working as expected? Please share results (execution output / picture) and I will merge if all good.

bmyers-dev commented 1 year ago

Seems like bug. Thanks @bmyers-dev for this fix! Did you run test to verify it's working as expected? Please share results (execution output / picture) and I will merge if all good.

@chkp-royl - I was able to test it tonight, seems to work as expected.

Example Config:

terraform {
  required_providers {
    checkpoint = {
      version = "1.0.0"
      source  = "bmyers-dev.com/local/checkpoint"
    }
  }
}

provider "checkpoint" {
  server   = "bmyers-tf-dev-ugz7lkws.maas.checkpoint.com"
}

resource "checkpoint_management_aws_data_center_server" "testAws" {
  name = "test-aws"
  authentication_method = "role-authentication"
  region               = "us-east-1"
  ignore_warnings = true
  enable_sts_assume_role = true
  sts_external_id        = "id-string"
  sts_role               = "test-role"
}

Example Output:

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # checkpoint_management_aws_data_center_server.testAws will be created
  + resource "checkpoint_management_aws_data_center_server" "testAws" {
      + authentication_method  = "role-authentication"
      + color                  = "black"
      + enable_sts_assume_role = true
      + id                     = (known after apply)
      + ignore_errors          = false
      + ignore_warnings        = true
      + name                   = "test-aws"
      + region                 = "us-east-1"
      + sts_external_id        = "id-string"
      + sts_role               = "test-role"
    }

Plan: 1 to add, 0 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

checkpoint_management_aws_data_center_server.testAws: Creating...
checkpoint_management_aws_data_center_server.testAws: Still creating... [10s elapsed]
checkpoint_management_aws_data_center_server.testAws: Creation complete after 10s [id=e1ea9a76-4856-4c5a-9d27-bd5c40b019a6]
Screen Shot 2023-03-01 at 10 33 43 PM Screen Shot 2023-03-01 at 10 34 13 PM
chkp-royl commented 1 year ago

Great looks good! Thanks for your contribution to our provider. Merged :)