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

akamai_datastream after akamai_property_bootstrap fails #583

Open
rolmo opened this issue Sep 26, 2024 · 2 comments
Open

akamai_datastream after akamai_property_bootstrap fails #583

rolmo opened this issue Sep 26, 2024 · 2 comments

Comments

@rolmo
Copy link

rolmo commented Sep 26, 2024

Hi there,

In the past, there was the problem that you needed the ID of a property for the akamai_datastream, but the property needed the ID of a akamai_datastream, which meant that the whole thing could not be rolled out automatically.

As far as I understand it, the resource akamai_property_bootstrap should be used for this:

  • With akamai_property_bootstrap, a property is created that does not have to contain any rules, but has a property ID.
  • The datastream can then be created with akamai_datastream.
  • The property can then be finalised with akamai_property and given rules that use the datastream via his ID.

But this fails.

Terraform and Akamai Terraform Provider Versions

Terraform: v1.9.6
Akamai-Provider: 6.4.0

Affected Resource(s)

  • akamai_property_bootstrap
  • akamai_datastream

Terraform Configuration Files

resource "akamai_property_bootstrap" "test" {
  name        = "test-akamai"
  contract_id = var.contract_id
  group_id    = var.group_id
  product_id  = var.product.product_id
}

resource "akamai_datastream" "test" {
  active             = true
  contract_id        = var.contract_id
  group_id           = var.group_id

  delivery_configuration {
    format             = "JSON"
    frequency {
      interval_in_secs = 30
    }
  }
  dataset_fields = [
    1000, 1005, 1006, 1008, 1009, 1013, 1016, 1017, 1032, 1068, 2002, 2003, 2005, 2010, 2012, 2020
  ]
  notification_emails = [
    "me@company.com"
  ]
  properties = [
    akamai_property_bootstrap.test.id
  ]
  stream_name        = "test-akamai"
  splunk_connector {
    display_name          = "Our Token"
    event_collector_token = var.splunk_token
    endpoint              = "https://http-inputs-spring.splunkcloud.com/services/collector/raw"
  }
}

Debug Output

The resource resource "akamai_datastream" "test" creates this error message:

One or more properties (xxxxxx) are invalid. Provide properties that are authorized to be a part of this stream, and belong to the xxxx contract and xxxxx group ID."

(But the (empty) property is created, has the right group and the right contract)

Expected Behavior

The datastream should created, because the property and datastream are in the same contract/group.

@mstojanowski
Copy link

mstojanowski commented Oct 7, 2024

Hi @rolmo,

akamai_property_bootstrap resource does not solve circular dependency problem with property and datastream. It only enables walkaround of that issue. The limitation is that you can not simply use it with single apply. You need two applies:

  1. Create and apply configuration containing:
  • akamai_cp_code
  • akamai_edge_hostname
  • akamai_property_bootstrap
  • akamai_property (with references to akamai_property_bootstrap)
  • akamai_property_activation
  • akamai_datastream (commented out, with reference to akamai_property_bootstrap id)
  • akamai_property_rules_builder (commented out datastream part)
    (Resources: 5 added, 0 changed, 0 destroyed.)
  1. Uncomment what was commented above and apply again.
    (Resources: 1 added, 2 changed, 0 destroyed.)

At this point this is the only way to have property with datastream created.

Please don't hesitate to ask if you need further help with this case.

Regards,
Marcin

@rolmo
Copy link
Author

rolmo commented Oct 11, 2024

Hello Marcin,

Okay - I see. But the whole thing is very cumbersome!

It would be ideal if you had a documentation for this - akamai_property_bootstrap is offered when exporting a propery in the Akamai CLI, but you can't find out the correct usage anywhere

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants