Skip to content

Commit

Permalink
Merge pull request #303 from akamai/release/v1.12.1
Browse files Browse the repository at this point in the history
Release/v1.12.1
  • Loading branch information
robertolopezlopez authored Apr 6, 2022
2 parents 18c6396 + 0ee2dcf commit 4570634
Show file tree
Hide file tree
Showing 8 changed files with 350 additions and 44 deletions.
3 changes: 3 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ archives:
- format: zip
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
checksum:
extra_files:
- glob: 'terraform-provider-manifest.json'
name_template: '{{ .ProjectName }}_{{ .Version }}_manifest.json'
name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS'
algorithm: sha256
signs:
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# RELEASE NOTES

## 1.12.1 (Apr 6, 2022)

#### BUG FIXES:

* Added Image and Video Manager Documentation

* Include `terraform-provider-manifest`

## 1.12.0 (Mar 31, 2022)

#### FEATURES/ENHANCEMENTS:
Expand Down
209 changes: 209 additions & 0 deletions docs/guides/get_started_imaging.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,209 @@
---
layout: "akamai"
page_title: "Module: Image and Video Manager"
description: |-
Image and Video Manager module for the Akamai Terraform Provider
---

# Image and Video Manager Guide (Beta)

The Image and Video Manager module lets you manage, optimize, and modify your images and short-form videos.
With Image and Video Manager, you can deliver a smooth, efficient, visually engaging customer experience that can also save you time and money.

~> Note: This functionality is currently in beta.

## About policies and policy sets

Image and Video Manager policies contain the settings to optimize and transform your images or videos.

A policy set is a collection of policies. An image policy set can contain only image policies, and a video policy set can contain only video policies.

~> Note: For more information about policies and policy sets, see [Create and edit policies](https://techdocs.akamai.com/ivm/docs/create-edit-policies) in the Image and Video Manager documentation.

### Policy and policy set relationships

Some things to keep in mind about policy sets and policies:

* A policy set belongs to a single contract.
* A policy belongs to a single policy set.
* A policy set can be used across multiple properties.
* A property can have multiple policy sets.

### The .auto policy

When you create a policy set, it automatically creates a default `.auto` policy.
This policy provides the baseline settings that
determine how the policy generates derivative images and videos.

### Activation considerations

By default, when you save a policy set, it's automatically activated on both staging and production networks.
Nothing happens to the policy set until you link it to a property.

When you save a policy, it's automatically activated on staging.
To activate a policy on production, you have to set the `activate_on_production` flag to `true` in either the [akamai_imaging_policy_image](../resources/akamai_imaging_policy_image.md) or [akamai_imaging_policy_video](../resources/akamai_imaging_video.md) resource, and save your change.

## Prerequisites

Before you start, make sure Image and Video Manager is in your contract, and your contract includes the type of media (images or videos or both) that you intend to work with.
You can find the list of products within your account in ​Control Center​ under Contracts.
Contact your ​Akamai​ support team to enable Image and Video Manager if necessary.

Complete the tasks in [Get Started with the Akamai Provider](https://registry.terraform.io/providers/akamai/akamai/latest/docs/guides/get_started_provider).
You should have an API client and a valid Terraform configuration before adding this module.

## Image and Video Manager workflow

* [Get the contract ID](#get-the-contract-id)
* [Export a policy set and related policies](#export-a-policy-set-and-related-policies)
* [Add policy sets](#add-policy-sets)
* [Add policies](#add-policies)
* [Update the property rule tree](#update-the-property-rule-tree)
* [Activate the property on staging](#activate-the-property-on-staging)
* [Test your images and videos](#test-your-images-and-videos)
* [Activate the policy on production](#activate-the-policy-on-production)
* [Activate the property on production](#activate-the-property-on-production)

## Get the contract ID

When setting up Image and Video Manager, you need to retrieve the Akamai ID for your contract.
You can use the [akamai_contract](../data-sources/contract.md) data source to get this ID.

~> **Note:** If you use prefixes with your IDs, you might have to remove the `ctr_` prefix from your entry.
For more information about prefixes, see the [ID prefixes](https://techdocs.akamai.com/property-mgr/reference/id-prefixes#remove-prefixes) section of the Property Manager API (PAPI) documentation.

## Export a policy set and related policies

For the beta of this module, you can use the [Terraform CLI](https://github.com/akamai/cli-terraform) to export an existing policy set and its related policies into JSON files.

You need to run the CLI separately for each policy set you want to add to your Terraform configuration.
Running the CLI on a policy set also generates the resources for related policies and the JSON files of policies.

~> **Note:** If you use the [Image and Video Manager API](https://techdocs.akamai.com/ivm/reference/api), you can also modify JSON files you have for existing policy sets and policies.
In Control Center, you can view and download policy JSON files by clicking **View Policy JSON** in the Policy Editor.

## Add policy sets

Use the [`akamai_imaging_policy_set`](../resources/imaging_policy_set.md) resource to add a policy set to your Akamai Provider configuration.
Each policy set you're adding needs to have its own resource in your Terraform configuration.

You need the name of the policy set's JSON file that you created during the [export process](#export-policy-sets).

By default, when you save a policy set, it's automatically activated on both staging and production networks.
Nothing happens to the policy set until you link it to a property.

Also, when you create a policy set, it automatically creates a default `.auto` policy.
This policy provides the baseline settings that
determine how the policy generates derivative images and videos.
You can't delete the `.auto` policy without deleting the policy set.

## Add policies

Use these policy resources to add policies to your Akamai Provider configuration:

* **Image policies:** See the [akamai_imaging_policy_image](../resources/akamai_imaging_policy_image.md) resource.
* **Video policies:** See the [akamai_imaging_policy_video](../resources/akamai_imaging_video.md) resource.

To set up these resources, you need the policy and policy set IDs found in the policy's JSON file.
This is one of the files created during the [export process](#export-policy-sets).
These IDs help link policy sets and policies to your property configuration.

Add a separate resource for each policy you're adding.

## Update the property rule tree

You need to add one or more imaging policy behaviors to the JSON rule tree file in each property you're adding image policies to.
See the [Set up property rules](../guides/get_started_property#set-up-property-rules) in the [Property Provisioning Module Guide](../guides/get_started_property.md) for additional information.

When adding these behaviors make sure that you use the correct policy set ID from the policy resource files.

If you wish to customize the behavior settings, see the Property Manager API (PAPI) behavior for the type of policy you're adding:

* **Image policies:** See the [`imageManager`](https://techdocs.akamai.com/property-mgr/reference/latest-imagemanager) behavior.
* **Video policies:** See the [`imageManagerVideo`](https://techdocs.akamai.com/property-mgr/reference/latest-imagemanagervideo) behavior.

### Example behaviors

**imageManager behavior:**

```
{
"name":"imageManager",
"options":{
"enabled":true,
"resize":false,
"applyBestFileType":true,
"cpCodeOriginal":{
"id":6789
},
"cpCodeTransformed":{
"id":12345
},
"policyTokenDefault":"default",
"superCacheRegion":"US",
"useExistingPolicySet":false,
"advanced":false
}
}
```

**imageManagerVideo behavior:**

```
{
"name":"imageManagerVideo",
"options":{
"enabled":true,
"resize":false,
"applyBestFileType":true,
"policyTokenDefault":"testToken",
"superCacheRegion":"US",
"useExistingPolicySet":false,
"advanced":false
}
}
```

## Activate the property on staging

To activate the property containing your newly added imaging policies, deploy the property to staging first.
In the [akamai_property_activation](/..resources/property_activation) resource, set the `network` argument to `staging` and deploy the change.

~> **Note:** By default, Image and Video Manager policies and policy sets are automatically available on staging once you save them.

```
resource "akamai_property_activation" "example_staging" {
property_id = akamai_property.example.id
contact = [local.email]
# NOTE: Specifying a version as shown here will target the latest version created. This latest version will always be activated in staging.
version = akamai_property.example.latest_version
network = "STAGING"
note = "Sample activation"
}
```

## Test your images and videos

Now that the property, policy sets, and policies are active on the staging network, you should verify that your images and videos are appearing as expected.

See [Test your policy on staging](https://techdocs.akamai.com/ivm/docs/test-on-staging) for more information.

## Activate the policy on production

Once you finish testing on staging, activate the policy on production by setting `activate_on_production` to `true` in the policy resource.

If you're modifying an existing policy resource that's been activated in production, set `activate_on_production` to `false`.
Changing this value doesn't remove the policy in production, but lets you safely make changes to the policy in staging.

## Activate the property on production

Once the policy is on production, you can then deploy your updated property to production.
Update the [akamai_property_activation](/..resources/property_activation) resource again, this time by setting the `network` argument to `production` and deploying the change.

## Maintenance

If needed, you can destroy policy sets and related policies.
When you remove a policy set, it removes all policies within that set including the `.auto` policy.

You can also remove individual policies from a policy set.
The exception is the `.auto` policy, which you can only remove if you delete the policy set.
5 changes: 2 additions & 3 deletions docs/guides/get_started_provider.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ for each of the modules you'll be using, and retrieve IDs for your contracts
and groups. Other tasks, like setting up your `.tf` configuration file, are
specific to Terraform.

-> **Note** Both Terraform and the Akamai Terraform CLI package come
pre-installed in the Akamai Development Environment. See [Set Up a Development Environment](https://developer.akamai.com/blog/2020/05/26/set-development-environment) for more information.

## Workflow

To set up the Akamai Provider, you need to:
Expand Down Expand Up @@ -51,6 +48,8 @@ answer these questions:

* **Modules.** Which modules do you plan to use? The API clients you set up depend on the modules you choose. For example, if you want to use the Common data sources and resources, you'll need read access to the Property Manager API.

-> **Note** If you’re adding any of these modules, you can use the [Akamai CLI for Terraform Provider](https://github.com/akamai/cli-terraform) to import your existing configurations: Cloudlets, Edge DNS, EdgeWorkers, Global Traffic Management, Image and Video Manager, and Property Manager.

* **Akamai configurations.** Are you going to use existing properties and other Akamai configurations with Terraform? Or are you going to start from scratch?

* **Single or multiple `.tf` files.** Do you want to manage the full lifecycle of your infrastructure in a single file? Or do you prefer to split it into smaller Terraform configurations with limited scope and delegate them to specific teams? Independent configurations use output variables to publish information and enable access to that data from other workspaces.
Expand Down
44 changes: 3 additions & 41 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,17 @@ description: |-

# Akamai Terraform Provider

Use the Akamai Terraform Provider to manage and provision your Akamai configurations in Terraform.
You can use the Akamai Provider today for many Akamai products.
Akamai powers and protects life online. Akamai's Intelligent Edge Platform makes it easier for developers and businesses to build, run, and secure applications. We keep decisions, apps, and experiences closer to users, and attacks and threats far away. Our portfolio includes edge security, web and mobile performance, enterprise access, and video delivery solutions.

!> Version 1.0.0 of the Akamai Terraform Provider is a major release that's currently available for the Provisioning module. Before upgrading, you need to make changes to some of your Provisioning resources and data sources. See [Upgrade to Version 1.0.0](guides/1.0_migration.md) for details.
Use the Akamai Terraform Provider to manage and provision your Akamai configurations in Terraform. You can use the Akamai Provider for many Akamai products.

Last updated: March 2022.

## Migrate to the newest version

If you're using the Provisioning module, the latest major version of the Akamai Provider is now available.
See [Upgrade to Version 1.0.0](guides/1.0_migration.md) for more information.

## Workflows

Here are the most common workflows for the Akamai Provider:

* **Set up the Provider the first time.** To do this, finish reviewing this guide, then go to [Get Started with the Akamai Provider](guides/get_started_provider.md). When setting up the Provider, you need to choose an [authentication method](guides/akamai_provider_auth.md), and decide whether to import existing Akamai configurations, or create new ones.
* **Add a new module to your existing Akamai Provider configuration.** If the Akamai Provider is already set up, and you're adding a new module, read the guide for the module you're adding:

* [Application Security](https://registry.terraform.io/providers/akamai/akamai/latest/docs/guides/get_started_appsec)
* [Certificate Provisioning (CPS)](https://registry.terraform.io/providers/akamai/akamai/latest/docs/guides/get_started_cps)
* [Cloudlets](https://registry.terraform.io/providers/akamai/akamai/latest/docs/guides/get_started_cloudlets)
* [DataStream](https://registry.terraform.io/providers/akamai/akamai/latest/docs/guides/get_started_datastream)
* [DNS Zone Administration](https://registry.terraform.io/providers/akamai/akamai/latest/docs/guides/get_started_dns_zone)
* [EdgeWorkers](https://registry.terraform.io/providers/akamai/akamai/latest/docs/guides/get_started_edgeworkers)
* [Global Traffic Management Domain Administration](https://registry.terraform.io/providers/akamai/akamai/latest/docs/guides/get_started_gtm_domain)
* [Identity and Access Management](https://registry.terraform.io/providers/akamai/akamai/latest/docs/guides/get_started_iam.md)
* [Network Lists](https://registry.terraform.io/providers/akamai/akamai/latest/docs/guides/get_started_networklists)
* [Provisioning/Property Manager](https://registry.terraform.io/providers/akamai/akamai/latest/docs/guides/get_started_property)
* **Update settings for an existing module.** Use the reference information for resource and data sources listed under each module, like DNS Zone Administration or Property Provisioning. You can find this documentation on the panel to the left.
* **Add a new module to your existing Akamai Provider configuration.** If the Akamai Provider is already set up, and you're adding a new module, select from the Guides category for the module you're adding.

## Manage changes to your Akamai configurations

Expand Down Expand Up @@ -67,22 +48,3 @@ If you're new to Terraform, here are some links you might find helpful:
* [Terraform module tutorials](https://learn.hashicorp.com/collections/terraform/modules)
* [Terraform configuration language tutorials](https://learn.hashicorp.com/collections/terraform/configuration-language)
* [Terraform glossary](https://www.terraform.io/docs/glossary.html)

## Available guides

Here's a list of the guides for the Akamai Provider in the general order you might use them:

* [Get Started with the Akamai Terraform Provider](https://registry.terraform.io/providers/akamai/akamai/latest/docs/guides/get_started_provider)
* [Authenticate the Akamai Terraform Provider](https://registry.terraform.io/providers/akamai/akamai/latest/docs/guides/akamai_provider_auth)
* [Upgrade to Version 1.0.0](https://registry.terraform.io/providers/akamai/akamai/latest/docs/guides/1.0_migration)
* [Application Security Module Guide](https://registry.terraform.io/providers/akamai/akamai/latest/docs/guides/get_started_appsec)
* [Certificate Provisioning Module Guide](https://registry.terraform.io/providers/akamai/akamai/latest/docs/guides/get_started_cps)
* [Cloudlets Module Guide](https://registry.terraform.io/providers/akamai/akamai/latest/docs/guides/get_started_cloudlets)
* [DataStream Module Guide](https://registry.terraform.io/providers/akamai/akamai/latest/docs/guides/get_started_datastream)
* [EdgeWorkers Module Guide](https://registry.terraform.io/providers/akamai/akamai/latest/docs/guides/get_started_edgeworkers)
* [DNS Zone Administration Module Guide](https://registry.terraform.io/providers/akamai/akamai/latest/docs/guides/get_started_dns_zone)
* [Global Traffic Management Domain Administration Module Guide](https://registry.terraform.io/providers/akamai/akamai/latest/docs/guides/get_started_gtm_domain)
* [Identity and Access Management Module Guide](https://registry.terraform.io/providers/akamai/akamai/latest/docs/guides/get_started_iam.md)
* [Network Lists Module Guide](https://registry.terraform.io/providers/akamai/akamai/latest/docs/guides/get_started_networklists)
* [Property Provisioning Module Guide](https://registry.terraform.io/providers/akamai/akamai/latest/docs/guides/get_started_property)
* [Shared Resources](https://registry.terraform.io/providers/akamai/akamai/latest/docs/guides/appendix)
47 changes: 47 additions & 0 deletions docs/resources/imaging_policy_image.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
layout: "akamai"
page_title: "Akamai: akamai_imaging_policy_image"
subcategory: "Image and Video Manager"
description: |-
Image and Video Manager image policy
---

# akamai_imaging_policy_image (Beta)

Use the `akamai_imaging_policy_image` data source to list details about a policy.

## Basic usage

This example returns the policy details based on the policy ID and optionally, a version:

```hcl
data "akamai_imaging_policy_image" "example" {
activate_on_production = false
version = 1
contract_id = "1234"
policy_id = "imgpolicy1234"
policyset_id = "akamai_imaging_policy_set.policy_set_name.id"
activate_on_production = true"
json = file("policy.json")
}
```

## Argument reference

This data source supports these arguments:
* `activate_on_production` - (Optional) With this flag set to `false`, the user can perform modifications on staging without affecting the version already saved to production.
With this flag set to `true`, the policy will also be saved on the production network.
It is possible to change it back to `false` only when there are any changes to the policy qualifying it for the new version.
It should be set to false whenever there are changes to policy to ensure that the change is deployed to and tested on staging first.
* `contract_id` - (Required) The unique identifier for the Akamai Contract containing the policy set.
* `policy_id` - (Required) The unique identifier of a policy.
It is not possible to modify the id of the policy.
* `policyset_id` - (Required) The unique identifier for the Image & Video Manager policy set.
* `json` - (Required) A JSON encoded policy.


## Attributes reference

This data source returns this attribute:

* `version` - The version number of the policy.
Loading

0 comments on commit 4570634

Please sign in to comment.