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

DXE-4025 Feature request: Cloudlets policy: Provide staging and production versions #564

Open
siwinski opened this issue Jun 30, 2024 · 1 comment

Comments

@siwinski
Copy link

The akamai_property resource provides version attributes latest_version, staging_version, and production_version which makes it possible to conditionally activate either the latest version or keep the version already currently activated on a network.

The akamai_cloudlets_policy resource only provides version attribute version (latest version) so it is not possible to conditionally activate the latest version or a version already currently activated on a network. Either the latest version always has to be activated or a hard-coded version can be activated.

See examples below in "Terraform Configuration Files" section.

Terraform and Akamai Terraform Provider Versions

Terraform v1.9.0
on linux_amd64
+ provider registry.terraform.io/akamai/akamai v6.2.0

Affected Resource(s)

akamai_cloudlets_policy

Terraform Configuration Files

Cloudlet activate latest version example:

resource "akamai_cloudlets_policy" "policy" {
  # ...
}

resource "akamai_cloudlets_policy_activation" "staging" {
  # ...
  network = "staging"
  version = akamai_cloudlets_policy.policy.version
}

resource "akamai_cloudlets_policy_activation" "production" {
  # ...
  network = "production"
  version = akamai_cloudlets_policy.policy.version
}

Cloudlet activate hard-coded version example:

resource "akamai_cloudlets_policy" "policy" {
  # ...
}

resource "akamai_cloudlets_policy_activation" "staging" {
  # ...
  network = "staging"
  version = 1
}

resource "akamai_cloudlets_policy_activation" "production" {
  # ...
  network = "production"
  version = 1
}

Property activate conditional version example:

variable "activate_latest_on_staging" {
  type = bool
}

variable "activate_latest_on_production" {
  type = bool
}

resource "akamai_property" "property" {
  # ...
}

resource "akamai_property_activation" "staging" {
  # ...
  network = "STAGING"
  version = (
    var.activate_latest_on_staging
    ? akamai_property.property.latest_version
    : akamai_property.property.staging_version
  )
}

resource "akamai_property_activation" "production" {
  # ...
  network = "PRODUCTION"
  version = (
    var.activate_latest_on_production
    ? akamai_property.property.latest_version
    : akamai_property.property.production_version
  )
}

Debug Output

N/A

Panic Output

N/A

Expected Behavior

akamai_cloudlets_policy resources provide staging and production version attributes (in addition to currently-provided latest version attribute) so activation versions can be conditional.

Actual Behavior

akamai_cloudlets_policy resources only provide the latest version attribute so forced to either always activate latest versions or activate hard-coded versions.

Steps to Reproduce

See examples above in "Terraform Configuration Files" section.

Important Factoids

I have tried using akamai_cloudlets_policy and akamai_cloudlets_shared_policy datasources to dynamically determine activated staging and production versions, but that has been proven unreliable as their activations attribute "empties" when new cloudlet versions are created but not activated right away (perhaps this is a bug in the datasources).

The following data sources should probably provide the same staging and production version attributes as well:

References

N/A

@lsadlon lsadlon changed the title Feature request: Cloudlets policy: Provide staging and production versions DXE-4025 Feature request: Cloudlets policy: Provide staging and production versions Jul 1, 2024
@lsadlon
Copy link

lsadlon commented Jul 1, 2024

Hi @siwinski

Thanks for this idea, we will think it over and go back to you.

BR,
Lukasz

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