Skip to content

Commit

Permalink
Merge pull request #364 from akamai/release/v3.1.0
Browse files Browse the repository at this point in the history
Release/v3.1.0
  • Loading branch information
wzagrajcz authored Dec 1, 2022
2 parents e9b4dda + 89b3b9f commit d3c9f2f
Show file tree
Hide file tree
Showing 593 changed files with 10,535 additions and 7,948 deletions.
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ builds:
- -trimpath
- -tags=all
ldflags:
- -s -w -X github.com/akamai/terraform-provider-akamai/v2/version.ProviderVersion={{.Version}}
- -s -w -X github.com/akamai/terraform-provider-akamai/v3/version.ProviderVersion={{.Version}}
goos:
- windows
- linux
Expand Down
22 changes: 21 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# RELEASE NOTES

## 3.1.0 (December 1, 2022)

#### FEATURES/ENHANCEMENTS:

* CPS
* New data sources:
* [akamai_cps_csr](docs/data-sources/cps_csr.md) - returns latest Certificate Signing Request for given enrollment
* [akamai_cps_deployments](docs/data-sources/cps_deployments.md) - returns deployed certificates for given enrollment
* [akamai_cps_warnings](docs/data-sources/cps_warnings.md) - returns a map of all possible CPS warnings (ID to warning message). The IDs can be later used to approve warnings (auto_approve_warnings field)
* Added resources allowing management of third-party enrollments:
* [akamai_cps_third_party_enrollment](docs/resources/cps_third_party_enrollment.md) - create, read, update, delete and import third-party enrollments
* [akamai_cps_upload_certificate](docs/resources/cps_upload_certificate.md) - create, read, update and delete
* Resource cps_dv_enrollment
* Deprecate `enable_multi_stacked_certificates` field. Now its value is always `false`.

#### BUG FIXES:

* PAPI
* Fixed update of ip_behavior in `akamai_edge_hostname` resource ([#354](https://github.com/akamai/terraform-provider-akamai/issues/354))

## 3.0.0 (October 27, 2022)

#### BREAKING CHANGES:
Expand Down Expand Up @@ -30,7 +50,7 @@

* GTM
* Fixed unreadable diff when single attribute is changed in traffic target

## 2.4.2 (October 4, 2022)

#### FEATURES/ENHANCEMENTS:
Expand Down
21 changes: 15 additions & 6 deletions GNUmakefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
TEST ?= $$(go list ./...)
GOFMT_FILES ?= $$(find . -name '*.go')
PKG_NAME = akamai

# Local provider install parameters
Expand Down Expand Up @@ -49,16 +48,21 @@ vet:
fi

.PHONY: fmt
fmt:
gofmt -w $(GOFMT_FILES)
fmt: |; $(info ==> Running goimports...)
goimports -w .

.PHONY: terraform-fmt
terraform-fmt:
terraform fmt -recursive -check

.PHONY: fmtcheck
fmtcheck:
@sh -c "'$(CURDIR)/scripts/gofmtcheck.sh'"
fmtcheck: |; $(info ==> Running format and imports check...)
$(eval OUTPUT = $(shell goimports -l .))
@if [ "$(OUTPUT)" != "" ]; then\
echo "Found following files with incorrect format and/or imports:";\
echo "$(OUTPUT)";\
false;\
fi

.PHONY: errcheck
errcheck:
Expand All @@ -83,13 +87,18 @@ tools.golangci-lint:
@echo Installing golangci-lint
@curl -sSfL https://github.com/raw/golangci/golangci-lint/master/install.sh | sh -s -- -b $$(go env GOPATH)/bin $(golangci-lint-version)

.PHONY: tools.goimports
tools.goimports:
@echo Installing goimports
go install golang.org/x/tools/cmd/goimports@latest

.PHONY: tools.tflint
tools.tflint:
@echo Installing tf-lint
@export TFLINT_VERSION=$(tflint-version) && curl -s https://github.com/raw/terraform-linters/tflint/master/install_linux.sh | bash

.PHONY: init
init: tools.golangci-lint tools.tflint
init: tools.golangci-lint tools.tflint tools.goimports

.PHONY: dummy-edgerc
dummy-edgerc:
Expand Down
8 changes: 4 additions & 4 deletions build/internal/docker_jenkins.bash
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
set -e

PROVIDER_BRANCH_NAME="${1:-develop}"
EDGEGRID_BRANCH_NAME="${2:-v2}"
EDGEGRID_BRANCH_NAME="${2:-develop}"
RELOAD_DOCKER_IMAGE="${3:-false}"

# Recalculate DOCKER_IMAGE_SIZE if any changes to dockerfile.
TIMEOUT="20m"
DOCKER_IMAGE_SIZE="673113557"
DOCKER_IMAGE_SIZE="651787326"

SSH_PRV_KEY="$(cat ~/.ssh/id_rsa)"
SSH_PUB_KEY="$(cat ~/.ssh/id_rsa.pub)"
Expand All @@ -26,7 +26,7 @@ COVERAGE_HTML="$COVERAGE_DIR"/index.html

WORKDIR="${WORKDIR-$(pwd)}"
echo "WORKDIR is $WORKDIR"
TERRAFORM_VERSION="1.0.4"
TERRAFORM_VERSION="1.2.5"

STASH_SERVER=git.source.akamai.com
GIT_IP=$(dig +short $STASH_SERVER)
Expand Down Expand Up @@ -92,7 +92,7 @@ docker exec akatf-container sh -c 'git clone ssh://git@git.source.akamai.com:799
echo "Checkout branches"
docker exec akatf-container sh -c 'cd edgegrid; git checkout ${EDGEGRID_BRANCH_NAME};
cd ../terraform-provider-akamai; git checkout ${PROVIDER_BRANCH_NAME};
go mod edit -replace github.com/akamai/AkamaiOPEN-edgegrid-golang/v2=../edgegrid;
go mod edit -replace github.com/akamai/AkamaiOPEN-edgegrid-golang/v3=../edgegrid;
go mod tidy -compat=1.17'

echo "Running tests with xUnit output"
Expand Down
2 changes: 1 addition & 1 deletion build/internal/package/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax=docker/dockerfile:1.0-experimental
ARG TERRAFORM_VERSION="1.0.4"
ARG TERRAFORM_VERSION="1.2.5"
FROM alpine:3.15
ENV PROVIDER_VERSION="1.0.0" \
CGO_ENABLED=0 \
Expand Down
22 changes: 7 additions & 15 deletions build/internal/package/nexus-release.bash
Original file line number Diff line number Diff line change
Expand Up @@ -34,30 +34,22 @@ clean() {
find_branch() {
CURRENT_BRANCH=$GIT_BRANCH
if [[ "$CURRENT_BRANCH" == "develop" ]]; then
EDGEGRID_BRANCH="v2"
EDGEGRID_BRANCH="develop"
else
# find parent branch from which this branch was created, iterate over the list of branches from the history of commits
branches=($(git log --pretty=format:'%D' | sed 's@HEAD -> @@' | grep . | sed 's@origin/@@g' | tr ', ' '\n' | grep -v 'tag:' | sed -E 's@v([0-9]+\.?){2,}(-rc\.[0-9]+)?@@g' | grep -v release/ | grep -v HEAD | sed '/^$/d'))
branches=($(git log --pretty=format:'%D' | sed 's@HEAD -> @@' | grep . | sed 's@origin/@@g' | sed 's@release/.*@@g' | sed -E $'s@master, (.+)@\\1, master@g' | tr ', ' '\n' | grep -v 'tag:' | sed -E 's@v([0-9]+\.?){2,}(-rc\.[0-9]+)?@@g' | grep -v release/ | grep -v HEAD | sed '/^$/d'))
for branch in ${branches[*]}
do
echo "Checking branch '${branch}'"
EDGEGRID_BRANCH=$branch

if [[ "$index" -eq "5" ]]; then
echo "Exceeding limit of checks, fallback to default branch 'v2'"
EDGEGRID_BRANCH="v2"
echo "Exceeding limit of checks, fallback to default branch 'develop'"
EDGEGRID_BRANCH="develop"
break
fi
index=$((index + 1))

if [[ "$branch" == "master" ]]; then
echo "Ignoring '${branch}'"
continue
fi

if [[ "$EDGEGRID_BRANCH" == "develop" ]]; then
EDGEGRID_BRANCH="v2"
fi
git -C ./akamaiopen-edgegrid-golang branch -r | grep $EDGEGRID_BRANCH > /dev/null
if [[ $? -eq 0 ]]; then
echo "There is matching EdgeGrid branch '${EDGEGRID_BRANCH}'"
Expand Down Expand Up @@ -91,7 +83,7 @@ checkout_edgegrid() {
}

adjust_edgegrid() {
go mod edit -replace github.com/akamai/AkamaiOPEN-edgegrid-golang/v2="./akamaiopen-edgegrid-golang"
go mod edit -replace github.com/akamai/AkamaiOPEN-edgegrid-golang/v3="./akamaiopen-edgegrid-golang"
go mod tidy -compat=1.17
}

Expand Down Expand Up @@ -129,8 +121,8 @@ nexus_push() {
}

mod_edit() {
edgegrid_version=$(go list -m -json -versions github.com/akamai/AkamaiOPEN-edgegrid-golang/v2 | python3 -c "import sys, json; print(json.load(sys.stdin)['Version'])")
go mod edit -replace github.com/akamai/AkamaiOPEN-edgegrid-golang/v2="stash.akamai.com/fee/akamaiopen-edgegrid-golang.git/v2@${edgegrid_version}"
edgegrid_version=$(go list -m -json -versions github.com/akamai/AkamaiOPEN-edgegrid-golang/v3 | python3 -c "import sys, json; print(json.load(sys.stdin)['Version'])")
go mod edit -replace github.com/akamai/AkamaiOPEN-edgegrid-golang/v3="stash.akamai.com/fee/akamaiopen-edgegrid-golang.git/v3@${edgegrid_version}"
}

outputs=()
Expand Down
2 changes: 1 addition & 1 deletion build/internal/releaser/goreleaser_build.bash
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cd /workspace/terraform-provider-akamai
go mod edit -replace github.com/akamai/AkamaiOPEN-edgegrid-golang/v2=../akamaiopen-edgegrid-golang/
go mod edit -replace github.com/akamai/AkamaiOPEN-edgegrid-golang/v3=../akamaiopen-edgegrid-golang/
git tag v10.0.0
goreleaser build --single-target --skip-validate --config ./.goreleaser.yml --output /root/.terraform.d/plugins/registry.terraform.io/akamai/akamai/10.0.0/linux_amd64/terraform-provider-akamai_v10.0.0
45 changes: 45 additions & 0 deletions docs/data-sources/cps_csr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
layout: akamai
subcategory: Certificate Provisioning System
---

# akamai_cps_csr

When setting up a third-party enrollment, use the `akamai_cps_csr` data source to retrieve the Certificate Signing Request (CSR) for that enrollment. When you create an enrollment in CPS, you also generate a PEM-formatted CSR. CPS encodes the CSR with a private key using either the RSA or the ECDSA algorithm. The CSR contains all the information the certificate authority (CA) needs to issue your certificate.

If you're using dual-stacked certificates, you'll see data for both ECDSA and RSA keys.

```
<blockquote style="border-left-style: solid; border-left-color: #5bc0de; border-width: 0.25em; padding: 1.33rem; background-color: #e3edf2;"><img src="https://techdocs.akamai.com/terraform-images/img/note.svg" style="float:left; display:inline;" /><div style="overflow:auto;">Dual-stacked certificates are enabled by default for third-party enrollments.
</div></blockquote>
```

## Basic usage

This example shows how to return CSR information for enrollment ID 12345:

```hcl
provider "akamai" {
edgerc = "../../config/edgerc"
}
data "akamai_cps_csr" "example" {
enrollment_id = 12345
}
```

## Argument reference

This data source supports this argument:

* `enrollment_id` - (Required) Unique identifier of the enrollment.

## Attributes reference

This data source returns these attributes:

* `csr_rsa` - Returns CSR information for a certificate that uses the RSA algorithm.
* `csr_ecdsa` - Returns CSR information for a certificate that uses the ECDSA algorithm.

45 changes: 45 additions & 0 deletions docs/data-sources/cps_deployments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
layout: akamai
subcategory: Certificate Provisioning System
---

# akamai_cps_deployments

Use the `akamai_cps_deployments` data source to retrieve deployed certificates for a specific enrollment.

You'll see data for ECDSA, RSA, or both depending on the type and number of certificates you uploaded.

## Basic usage

This example shows how to return information about deployed certificates for enrollment ID 12345.

```hcl
provider "akamai" {
edgerc = "../../config/edgerc"
}
data "akamai_cps_deployments" "example" {
enrollment_id = 12345
}
```

## Argument reference

This data source supports this argument:

* `enrollment_id` - (Required) Unique identifier of the enrollment.

## Attributes reference

This data source returns these attributes:

* `production_certificate_rsa` - The RSA certificate deployed on the production network.
* `production_certificate_ecdsa` - The ECDSA certificate deployed on the production network.
* `staging_certificate_rsa` - The RSA certificate deployed on the staging network.
* `staging_certificate_ecdsa` - The ECDSA certificate deployed on the staging network.
* `expiry_date` - The expiration date for the certificate in ISO-8601 format.
* `auto_renewal_start_time` - The specific date the automatic renewal will start on. The date is in ISO-8601 format. <br> For DV certificates, CPS automatically starts the renewal process 90 days before the current certificate expires. It then automatically deploys the renewed certificate when it receives it from the CA. <br> For third-party certificates, CPS creates a change. This change is needed to get a new CSR and upload the new certificate. Use the `akamai_cps_enrollments` data source to view pending changes.
39 changes: 39 additions & 0 deletions docs/data-sources/cps_warnings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
layout: akamai
subcategory: Certificate Provisioning System
---

# akamai_cps_warnings

Use the `akamai_cps_warnings` data source to return a map of all possible pre- and post-verification warnings. The map includes both the ID needed to acknowledge a warning and a brief description of the issue.

CPS produces warnings during enrollment creation or after a client uploads the certificate. CPS won't process a change until you acknowledge all warnings.

You can use the warning IDs returned by this data source to acknowledge or auto-approve warnings. The `akamai_cps_third_party_enrollment` and `akamai_cps_upload_certificate` resources include arguments to help you do this.

## Basic usage

This example shows how to return a map of verification warnings:

```hcl
provider "akamai" {
edgerc = "../config/edgerc"
config_section = "shared_dns"
}
data "akamai_cps_warnings" "example" {}
```

## Argument reference

This data source supports does not support any arguments.


## Attributes reference

This data source returns this attribute:

* `warnings` - Validation warnings for the current change you're making. Warnings display with an ID and a short description. Unless you auto-approve warnings, you need the ID to acknowledge the change. CPS won't process the change until you acknowledge these warnings.

Loading

0 comments on commit d3c9f2f

Please sign in to comment.