Skip to content

Add retry to acl endpoint for config update #201

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

Merged
merged 1 commit into from
Dec 6, 2024

Conversation

mploski
Copy link
Collaborator

@mploski mploski commented Dec 5, 2024

it seems there is a bug in the splunk terraform provider for config creation, that after config is created it doesn't propagate immediately and correspoding acl update returns 404 ( acl doesnt exist)

terragrunt apply

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:

  # splunk_configs_conf.aws_ta_example will be created
  + resource "splunk_configs_conf" "aws_ta_example" {
      + id        = (known after apply)
      + name      = "aws_config_rule/myconfig2"
      + variables = {
          + "custom_key" = "value"
          + "disabled"   = "false"
        }

      + acl {
          + app              = "Splunk_TA_aws"
          + can_change_perms = (known after apply)
          + can_share_app    = (known after apply)
          + can_share_global = (known after apply)
          + can_share_user   = (known after apply)
          + can_write        = (known after apply)
          + owner            = "nobody"
          + read             = (known after apply)
          + removable        = (known after apply)
          + sharing          = (known after apply)
          + write            = (known after apply)
        }
    }

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

splunk_configs_conf.aws_ta_example: Creating...
╷
│ Error: GET failed for endpoint servicesNS/nobody/Splunk_TA_aws/configs/conf-aws_config_rule/myconfig2/acl: 404 Not Found: {"messages":[{"type":"ERROR","text":"Could not find object id=myconfig2"}]}
│ 
│   with splunk_configs_conf.aws_ta_example,
│   on splunkbase_apps.tf line 15, in resource "splunk_configs_conf" "aws_ta_example":
│   15: resource "splunk_configs_conf" "aws_ta_example" {
│ 
╵
ERRO[0008] terraform invocation failed in /Users/mploski/splunk/skynet-apps-cyberdyne/terraform/stg/core/skynet-agile-staging  error=[/Users/mploski/splunk/skynet-apps-cyberdyne/terraform/stg/core/skynet-agile-staging] exit status 1
ERRO[0008] 1 error occurred:
        * [/Users/mploski/splunk/skynet-apps-cyberdyne/terraform/stg/core/skynet-agile-staging] exit status 1
 

---
➜ git:(feature/configure-splunkbase-app) ✗ terragrunt apply

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:

  # splunk_configs_conf.aws_ta_example will be created
  + resource "splunk_configs_conf" "aws_ta_example" {
      + id        = (known after apply)
      + name      = "aws_config_rule/myconfig2"
      + variables = {
          + "custom_key" = "value"
          + "disabled"   = "false"
        }

      + acl {
          + app              = "Splunk_TA_aws"
          + can_change_perms = (known after apply)
          + can_share_app    = (known after apply)
          + can_share_global = (known after apply)
          + can_share_user   = (known after apply)
          + can_write        = (known after apply)
          + owner            = "nobody"
          + read             = (known after apply)
          + removable        = (known after apply)
          + sharing          = (known after apply)
          + write            = (known after apply)
        }
    }

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

splunk_configs_conf.aws_ta_example: Creating...
╷
│ Error: 409 Conflict: {"messages":[{"type":"ERROR","text":"An object with name=myconfig2 already exists"}]}
│ 
│   with splunk_configs_conf.aws_ta_example,
│   on splunkbase_apps.tf line 15, in resource "splunk_configs_conf" "aws_ta_example":
│   15: resource "splunk_configs_conf" "aws_ta_example" {
│ 


# cat aws_config_rule.conf 
[myweblogs]
CHARSET = UTF-8
SHOULD_LINEMERGE = false

[myconfig2]
custom_key = value
disabled = false

@mploski mploski changed the title Add retry to acl endpoint update Add retry to acl endpoint for config update Dec 5, 2024
@mploski mploski merged commit e8397ea into splunk:master Dec 6, 2024
2 checks passed
@mploski mploski deleted the fix/config-create-acl-retry branch December 6, 2024 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants