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

Release/v5.3.0 #474

Merged
merged 16 commits into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,15 @@ jobs:
uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
- name: Prepare env
run: make init
- name: Prepare terraform tools
- name: Install terraform
run: make tools.terraform
- name: Prepare dummy edgerc
run: make dummy-edgerc
- name: Run checks
run: make check
- name: Run linter
run: make lint
- name: Create build
run: make build
- name: Run tests
run: make test
- name: Run terraform-fmt
run: make terraform-fmt
- name: Run terraform lint
- name: Run terraform fmt check
run: make terraform-fmtcheck
- name: Run tflint
run: make terraform-lint
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.18
go-version: 1.20
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v5
Expand All @@ -41,7 +41,7 @@ jobs:
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: v1.18.2
version: v1.20.0
args: release --rm-dist
env:
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# testing and custom build code
.terraform/
.build/
terraform-provider-akamai
terraform.tfstate
terraform.tfstate.backup
*.log
tools/bin/

# local files
.DS_Store
Expand Down
31 changes: 29 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
# RELEASE NOTES

## 5.3.0 (Sep 26, 2023)

#### FEATURES/ENHANCEMENTS:

* Appsec
* Added `sync_point` value in `akamai_networklist_network_lists` data source

* CPS
* Added `pending_changes` computed field to `akamai_cps_enrollment` data source ([#PR468](https://github.com/akamai/terraform-provider-akamai/pull/468))

* Cloud Wrapper
* Added support for `comments` argument modification in `akamai_cloudwrapper_configuration` resource

#### BUG FIXES:

* Appsec
* Fixed `akamai_networklist_network_list` import resulting in null `contract_id` and `group_id`

* PAPI
* Added errors to `data_property_akamai_contract` and `data_property_akamai_group` data sources, when fetching groups returns multiple inconclusive results
* Fixed drift issue in `akamai_edge_hostname` resource [(#457)](https://github.com/akamai/terraform-provider-akamai/issues/457)
* Added missing fields to `akamai_property_builder` for `origin` and `siteShield` behaviors ([#465](https://github.com/akamai/terraform-provider-akamai/issues/465))
* Improved `akamai_property_rules_builder` empty list transformation ([#438](https://github.com/akamai/terraform-provider-akamai/issues/438))

* GTM
* Added better drift handling in `akamai_gtm_property` - when property is removed without terraform knowledge, resource doesn't just error on refresh but suggests recreation

## 5.2.0 (Aug 29, 2023)

#### FEATURES/ENHANCEMENTS:
Expand Down Expand Up @@ -1034,8 +1061,8 @@ These are the operations supported in the Network Lists API v2:
These are the operations supported in the Identity Management: User Administration API v2:

* Create a new user
* Update a user’s profile
* Update a user’s role assignments
* Update a user’s profile
* Update a user’s role assignments
* Delete a user

## 1.1.1 (Jan 8, 2021)
Expand Down
90 changes: 37 additions & 53 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,25 @@ build_dir = .build
TF_PLUGIN_DIR ?= ~/.terraform.d/plugins
install_path = $(TF_PLUGIN_DIR)/$(registry_name)/$(namespace)/$(PKG_NAME)/$(version)/$$(go env GOOS)_$$(go env GOARCH)

# Tools versions
golangci-lint-version = v1.52.2
tflint-version = v0.45.0
# Developer tools
TOOLS_MOD_FILE := $(CURDIR)/tools/go.mod
TOOLS_BIN_DIR := $(CURDIR)/tools/bin
TOOL_PKGS := $(shell go list -f '{{join .Imports " "}}' tools/tools.go)
TOOLS := $(foreach TOOL,$(notdir $(TOOL_PKGS)),$(TOOLS_BIN_DIR)/$(TOOL))
$(foreach TOOL,$(TOOLS),$(eval $(notdir $(TOOL)) := $(TOOL))) # Allows to use e.g. $(golangci-lint) instead of $(TOOLS_BIN_DIR)/golangci-lint

$(TOOLS_BIN_DIR):
@mkdir -p $(TOOLS_BIN_DIR)

$(TOOLS_MOD_FILE): tidy

$(TOOLS): $(TOOLS_MOD_FILE) | $(TOOLS_BIN_DIR)
$(eval TOOL := $(filter %/$(@F),$(TOOL_PKGS)))
$(eval TOOL_VERSION := $(shell grep -m 1 $(shell echo $(TOOL) | cut -d/ -f 1-3) $(TOOLS_MOD_FILE) | cut -d' ' -f2))
@echo "Installing $(TOOL)@$(TOOL_VERSION)"
@GOBIN=$(TOOLS_BIN_DIR) go install -modfile=$(TOOLS_MOD_FILE) $(TOOL)

# Targets
default: build

.PHONY: install
Expand All @@ -24,10 +39,12 @@ install: build
.PHONY: build
build:
mkdir -p $(build_dir)
go build -tags all -o $(build_dir)/$(bin_name)
go build -o $(build_dir)/$(bin_name)

.PHONY: check
check: fmtcheck lint vet
.PHONY: tidy
tidy:
@go mod tidy
@cd tools && go mod tidy

.PHONY: test
test:
Expand All @@ -37,68 +54,35 @@ test:
testacc:
TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 300m

.PHONY: vet
vet:
@echo "==> Checking source code against vet"
@go vet $$(go list ./...); if [ $$? -ne 0 ]; then \
echo ""; \
echo "Vet found suspicious constructs. Please check the reported constructs"; \
echo "and fix them if necessary before submitting the code for review."; \
exit 1; \
fi

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

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

.PHONY: fmtcheck
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: lint
lint:
@echo "==> Checking source code against golangci-lint"
@$$(go env GOPATH)/bin/golangci-lint run
lint: $(golangci-lint)
$(golangci-lint) run

.PHONY: terraform-lint
terraform-lint:
@echo "==> Checking source code against tflint"
@find ./examples -type f -name "*.tf" | xargs -I % dirname % | sort -u | xargs -I @ sh -c "echo @ && tflint @"
terraform-lint: $(tflint)
@find ./examples -type f -name "*.tf" | xargs -I % dirname % | sort -u | xargs -I @ sh -c "echo @ && $(tflint) @"

.PHONY: test-compile
test-compile:
go test -c ./akamai $(TESTARGS)

.PHONY: tools.golangci-lint
tools.golangci-lint:
@echo Installing golangci-lint
@curl -sSfL https://raw.githubusercontent.com/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
tools: $(TOOLS)

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

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

.PHONY: dummy-edgerc
dummy-edgerc:
@sh -c "'$(CURDIR)/scripts/dummyedgerc.sh'"
init: tools tools.terraform

.PHONY: tools.terraform
tools.terraform:
Expand Down
29 changes: 11 additions & 18 deletions build/internal/docker_jenkins.bash
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RELOAD_DOCKER_IMAGE="${3:-false}"

# Recalculate DOCKER_IMAGE_SIZE if any changes to dockerfile.
TIMEOUT="40m"
DOCKER_IMAGE_SIZE="651787326"
DOCKER_IMAGE_SIZE="554443852"

SSH_PRV_KEY="$(cat ~/.ssh/id_rsa)"
SSH_PUB_KEY="$(cat ~/.ssh/id_rsa.pub)"
Expand All @@ -37,8 +37,6 @@ PROVIDER_BRANCH_HASH="$(git rev-parse --short HEAD)"
echo "Making build on branch $PROVIDER_BRANCH_NAME at hash $PROVIDER_BRANCH_HASH with tag $eTAG"

mkdir -p $COVERAGE_DIR
cp "$HOME"/.edgerc "$WORKDIR"/.edgerc
sed -i -e "1s/^.*$/[default]/" "$WORKDIR"/.edgerc

docker rm -f akatf-container 2> /dev/null || true

Expand Down Expand Up @@ -70,6 +68,7 @@ docker run -d -it --name akatf-container --entrypoint "/usr/bin/tail" \
-e SSH_KNOWN_HOSTS="${SSH_KNOWN_HOSTS}" \
-e SSH_CONFIG="${SSH_CONFIG}" \
-e TIMEOUT="$TIMEOUT" \
-e TERRAFORM_VERSION="$TERRAFORM_VERSION" \
-v "$HOME"/.ssh/id_rsa=/root/id_rsa \
-v "$HOME"/.ssh/id_rsa.pub=/root/id_rsa.pub \
-v "$HOME"/.ssh/known_hosts=/root/known_hosts \
Expand All @@ -92,26 +91,22 @@ docker exec akatf-container sh -c 'git clone ssh://[email protected]: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/v7=../edgegrid;
go mod tidy -compat=1.18'
go mod edit -replace github.com/akamai/AkamaiOPEN-edgegrid-golang/v7=../edgegrid'

echo "Running golangci-lint"
docker exec akatf-container sh -c 'cd terraform-provider-akamai; golangci-lint run'
echo "Installing terraform"
docker exec akatf-container sh -c 'cd terraform-provider-akamai; make tools.terraform'

echo "Running gofmt check"
if ! docker exec akatf-container sh -c 'cd terraform-provider-akamai; test -z $(gofmt -l .)'; then
echo "gofmt check failed"
exit 1
fi
echo "Running golangci-lint"
docker exec akatf-container sh -c 'cd terraform-provider-akamai; make lint'

echo "Running terraform fmt"
docker exec akatf-container sh -c 'cd terraform-provider-akamai; terraform fmt -recursive -check'
docker exec akatf-container sh -c 'cd terraform-provider-akamai; make terraform-fmtcheck'

echo "Running tflint on examples"
docker exec akatf-container sh -c 'cd terraform-provider-akamai; find ./examples -type f -name "*.tf" | xargs -I % dirname % | sort -u | xargs -I @ sh -c "echo @ && tflint @"'
docker exec akatf-container sh -c 'cd terraform-provider-akamai; make terraform-lint'

echo "Running tests with xUnit output"
docker exec akatf-container sh -c 'cd terraform-provider-akamai; go mod tidy -compat=1.18;
docker exec akatf-container sh -c 'cd terraform-provider-akamai; go mod tidy;
2>&1 go test -timeout $TIMEOUT -v -coverpkg=./... -coverprofile=../profile.out -covermode=$COVERMODE ./... | tee ../tests.output'
docker exec akatf-container sh -c 'cat tests.output | go-junit-report' > test/tests.xml
docker exec akatf-container sh -c 'cat tests.output' > test/tests.output
Expand All @@ -125,8 +120,6 @@ docker exec akatf-container sh -c 'cat index.html' > "$COVERAGE_HTML"
docker exec akatf-container sh -c 'cat coverage.xml' > "$COVERAGE_XML"

echo "Creating docker build"
docker exec akatf-container sh -c 'cd terraform-provider-akamai; go install -tags all;
mkdir -p /root/.terraform.d/plugins/registry.terraform.io/akamai/akamai/${PROVIDER_VERSION}/linux_amd64;
cp /root/go/bin/terraform-provider-akamai /root/.terraform.d/plugins/registry.terraform.io/akamai/akamai/${PROVIDER_VERSION}/linux_amd64/terraform-provider-akamai_v${PROVIDER_VERSION}'
docker exec akatf-container sh -c 'cd terraform-provider-akamai; make build'

docker rm -f akatf-container 2> /dev/null || true
15 changes: 5 additions & 10 deletions build/internal/package/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,21 @@
# syntax=docker/dockerfile:1.0-experimental
ARG TERRAFORM_VERSION="1.4.6"
FROM alpine:3.16
FROM golang:1.20-alpine3.18

ENV PROVIDER_VERSION="1.0.0" \
CGO_ENABLED=0 \
GOOS="linux" \
GOARCH="amd64" \
PATH=$PATH:/usr/local/go/bin:/root/go/bin \
TFLINT_VERSION="v0.45.0"
PATH=$PATH:/usr/local/go/bin:/root/go/bin

ARG GOLANGCI_LINT_VERSION="v1.50.1"
ARG SSH_PRV_KEY
ARG SSH_PUB_KEY
ARG SSH_KNOWN_HOSTS
WORKDIR $GOPATH/src/github.com/akamai

RUN apk add --update git bash sudo openssh gcc go musl-dev openssl-dev ca-certificates unzip curl terraform && \
RUN apk add --update git bash sudo openssh gcc go musl-dev openssl-dev ca-certificates unzip curl make && \
go install github.com/axw/gocov/gocov@latest && \
go install github.com/AlekSi/gocov-xml@latest && \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin ${GOLANGCI_LINT_VERSION} && \
go install github.com/jstemmer/go-junit-report@latest && \
mkdir -p /root/.ssh && \
curl -s https://raw.githubusercontent.com/terraform-linters/tflint/master/install_linux.sh | bash
mkdir -p /root/.ssh

ADD build/internal/package/AkamaiCorpRoot-G1.pem /usr/local/share/ca-certificates/AkamaiCorpRoot-G1.pem
RUN update-ca-certificates
28 changes: 14 additions & 14 deletions docs/data-sources/data-sources.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ We’ve moved our documentation to the Akamai TechDocs site. Use the table to fi

| Subprovider | Description |
|---------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------|
| [Application Security](https://techdocs.akamai.com/terraform/v5.2/docs/appsec-datasources) | Manage security configurations, security policies, match targets, rate policies, and firewall rules. |
| [Bot Manager](https://techdocs.akamai.com/terraform/v5.2/docs/botman-datasources) | Identify, track, and respond to bot activity on your domain or in your app. |
| [Certificates](https://techdocs.akamai.com/terraform/v5.2/docs/cps-datasources) | Full life cycle management of SSL certificates for your ​Akamai​ CDN applications. |
| [Client Lists](https://techdocs.akamai.com/terraform/v5.2/docs/cli-data-sources) | Reduce harmful security attacks by allowing only trusted IP/CIDRs, locations, autonomous system numbers, and TLS fingerprints to access your services and content.|
| [Cloud Wrapper](https://techdocs.akamai.com/terraform/v5.2/docs/cw-data-sources) | Provide your customers with a more consistent user experience by adding a custom caching layer that improves the connection between your cloud infrastructure and the Akamai platform.|
| [Cloudlets](https://techdocs.akamai.com/terraform/v5.2/docs/cl-datasources) | Solve specific business challenges using value-added apps that complement ​Akamai​'s core solutions. |
| [DataStream](https://techdocs.akamai.com/terraform/v5.2/docs/ds-datasources) | Monitor activity on the ​Akamai​ platform and send live log data to a destination of your choice. |
| [Edge DNS](https://techdocs.akamai.com/terraform/v5.2/docs/edns-datasources) | Replace or augment your DNS infrastructure with a cloud-based authoritative DNS solution. |
| [EdgeWorkers](https://techdocs.akamai.com/terraform/v5.2/docs/ew-datasources) | Execute JavaScript functions at the edge to optimize site performance and customize web experiences. |
| [Global Traffic Management](https://techdocs.akamai.com/terraform/v5.2/docs/gtm-datasources) | Use load balancing to manage website and mobile performance demands. |
| [Identity and Access Management](https://techdocs.akamai.com/terraform/v5.2/docs/iam-datasources) | Create users and groups, and define policies that manage access to your Akamai applications. |
| [Image and Video Manager](https://techdocs.akamai.com/terraform/v5.2/docs/ivm-datasources) | Automate image and video delivery optimizations for your website visitors. |
| [Network Lists](https://techdocs.akamai.com/terraform/v5.2/docs/nl-datasources) | Automate the creation, deployment, and management of lists used in ​Akamai​ security products. |
| [Property](https://techdocs.akamai.com/terraform/v5.2/docs/pm-datasources) | Define rules and behaviors that govern your website delivery based on match criteria. |
| [Application Security](https://techdocs.akamai.com/terraform/v5.3/docs/appsec-datasources) | Manage security configurations, security policies, match targets, rate policies, and firewall rules. |
| [Bot Manager](https://techdocs.akamai.com/terraform/v5.3/docs/botman-datasources) | Identify, track, and respond to bot activity on your domain or in your app. |
| [Certificates](https://techdocs.akamai.com/terraform/v5.3/docs/cps-datasources) | Full life cycle management of SSL certificates for your ​Akamai​ CDN applications. |
| [Client Lists](https://techdocs.akamai.com/terraform/v5.3/docs/cli-data-sources) | Reduce harmful security attacks by allowing only trusted IP/CIDRs, locations, autonomous system numbers, and TLS fingerprints to access your services and content.|
| [Cloud Wrapper](https://techdocs.akamai.com/terraform/v5.3/docs/cw-data-sources) | Provide your customers with a more consistent user experience by adding a custom caching layer that improves the connection between your cloud infrastructure and the Akamai platform.|
| [Cloudlets](https://techdocs.akamai.com/terraform/v5.3/docs/cl-datasources) | Solve specific business challenges using value-added apps that complement ​Akamai​'s core solutions. |
| [DataStream](https://techdocs.akamai.com/terraform/v5.3/docs/ds-datasources) | Monitor activity on the ​Akamai​ platform and send live log data to a destination of your choice. |
| [Edge DNS](https://techdocs.akamai.com/terraform/v5.3/docs/edns-datasources) | Replace or augment your DNS infrastructure with a cloud-based authoritative DNS solution. |
| [EdgeWorkers](https://techdocs.akamai.com/terraform/v5.3/docs/ew-datasources) | Execute JavaScript functions at the edge to optimize site performance and customize web experiences. |
| [Global Traffic Management](https://techdocs.akamai.com/terraform/v5.3/docs/gtm-datasources) | Use load balancing to manage website and mobile performance demands. |
| [Identity and Access Management](https://techdocs.akamai.com/terraform/v5.3/docs/iam-datasources) | Create users and groups, and define policies that manage access to your Akamai applications. |
| [Image and Video Manager](https://techdocs.akamai.com/terraform/v5.3/docs/ivm-datasources) | Automate image and video delivery optimizations for your website visitors. |
| [Network Lists](https://techdocs.akamai.com/terraform/v5.3/docs/nl-datasources) | Automate the creation, deployment, and management of lists used in ​Akamai​ security products. |
| [Property](https://techdocs.akamai.com/terraform/v5.3/docs/pm-datasources) | Define rules and behaviors that govern your website delivery based on match criteria. |
Loading