diff --git a/CHANGELOG.md b/CHANGELOG.md index acb6b338d..7f14f3b14 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # RELEASE NOTES +## 6.1.0 (Apr 23, 2024) + +#### FEATURES/ENHANCEMENTS: + +* DNS + * Added second mode to `akamai_dns_record` resource where it is possible to provide individual values for priority, weight and port to **every** `SRV` target. + In such case it is not allowed to provide values for resource level fields `priority`, `weight` and `port`. + It is not allowed to mix targets with and without those fields. + ([I#370](https://github.com/akamai/terraform-provider-akamai/issues/370)) + +* Image and Video Manager + * Added support for `SmartCrop` transformation in `akamai_imaging_policy_image` datasource + +#### BUG FIXES: + +* CPS + * Fixed issue with terraform producing inconsistent final plan for `akamai_cps_upload_certificate` resource on SAN list modification in `akamai_cps_third_party_enrollment` resource. + ## 6.0.0 (Mar 26, 2024) #### BREAKING CHANGES: diff --git a/GNUmakefile b/GNUmakefile index 34f3424a2..38b8fedea 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -14,6 +14,7 @@ BIN = $(CURDIR)/bin GOCMD = go GOTEST = $(GOCMD) test GOBUILD = $(GOCMD) build +GOMODTIDY = $(GOCMD) mod tidy M = $(shell echo ">") TFLINT = $(BIN)/tflint $(BIN)/tflint: $(BIN) ; $(info $(M) Installing tflint...) @@ -47,20 +48,20 @@ install: build .PHONY: build build: mkdir -p $(build_dir) - go build -o $(build_dir)/$(bin_name) + $(GOBUILD) -o $(build_dir)/$(bin_name) .PHONY: tidy -tidy: - @go mod tidy - @cd tools && go mod tidy +tidy: ; $(info $(M) Running go mod tidy...) @ + @$(GOMODTIDY) + @cd tools && $(GOMODTIDY) .PHONY: test test: - go test $(TEST) -v $(TESTARGS) -timeout 40m 2>&1 + $(GOTEST) $(TEST) -v $(TESTARGS) -timeout 40m 2>&1 .PHONY: testacc testacc: - TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 300m + TF_ACC=1 $(GOTEST) $(TEST) -v $(TESTARGS) -timeout 300m .PHONY: fmt fmt: | $(GOIMPORTS); $(info $(M) Running goimports...) @ ## Run goimports on all source files @@ -85,7 +86,6 @@ terraform-fmt: .PHONY: lint lint: | $(GOLANGCILINT) ; $(info $(M) Running golangci-lint...) @ - go mod tidy $Q $(BIN)/golangci-lint run .PHONY: terraform-lint @@ -94,7 +94,7 @@ terraform-lint: | $(TFLINT) ; $(info $(M) Checking source code against tflint... .PHONY: test-compile test-compile: - go test -c ./akamai $(TESTARGS) + $(GOTEST) -c ./akamai $(TESTARGS) .PHONY: tools tools: $(TOOLS) diff --git a/build/internal/docker_jenkins.bash b/build/internal/docker_jenkins.bash index d1a10acda..346b352ab 100755 --- a/build/internal/docker_jenkins.bash +++ b/build/internal/docker_jenkins.bash @@ -96,6 +96,9 @@ docker exec akatf-container sh -c 'cd edgegrid; git checkout ${EDGEGRID_BRANCH_N echo "Installing terraform" docker exec akatf-container sh -c 'cd terraform-provider-akamai; make tools.terraform' +echo "Running go mod tidy" +docker exec akatf-container sh -c 'cd terraform-provider-akamai; make tidy' + echo "Running golangci-lint" docker exec akatf-container sh -c 'cd terraform-provider-akamai; make lint' @@ -106,7 +109,7 @@ echo "Running tflint on examples" 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; +docker exec akatf-container sh -c 'cd terraform-provider-akamai; 2>&1 go test -timeout $TIMEOUT -v -coverpkg=./... -coverprofile=../profile.out -covermode=$COVERMODE -skip TestClient_DefaultRetryPolicy_TLS ./... | 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 diff --git a/docs/data-sources/data-sources.md b/docs/data-sources/data-sources.md index a2305c0d8..759c85afe 100644 --- a/docs/data-sources/data-sources.md +++ b/docs/data-sources/data-sources.md @@ -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/v6.0/docs/appsec-datasources) | Manage security configurations, security policies, match targets, rate policies, and firewall rules. | -| [Bot Manager](https://techdocs.akamai.com/terraform/v6.0/docs/botman-datasources) | Identify, track, and respond to bot activity on your domain or in your app. | -| [Certificates](https://techdocs.akamai.com/terraform/v6.0/docs/cps-datasources) | Full life cycle management of SSL certificates for your ​Akamai​ CDN applications. | -| [Client Lists](https://techdocs.akamai.com/terraform/v6.0/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/v6.0/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/v6.0/docs/cl-datasources) | Solve specific business challenges using value-added apps that complement ​Akamai​'s core solutions. | -| [DataStream](https://techdocs.akamai.com/terraform/v6.0/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/v6.0/docs/edns-datasources) | Replace or augment your DNS infrastructure with a cloud-based authoritative DNS solution. | -| [EdgeWorkers](https://techdocs.akamai.com/terraform/v6.0/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/v6.0/docs/gtm-datasources) | Use load balancing to manage website and mobile performance demands. | -| [Identity and Access Management](https://techdocs.akamai.com/terraform/v6.0/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/v6.0/docs/ivm-datasources) | Automate image and video delivery optimizations for your website visitors. | -| [Network Lists](https://techdocs.akamai.com/terraform/v6.0/docs/nl-datasources) | Automate the creation, deployment, and management of lists used in ​Akamai​ security products. | -| [Property](https://techdocs.akamai.com/terraform/v6.0/docs/pm-datasources) | Define rules and behaviors that govern your website delivery based on match criteria. | +| [Application Security](https://techdocs.akamai.com/terraform/v6.1/docs/appsec-datasources) | Manage security configurations, security policies, match targets, rate policies, and firewall rules. | +| [Bot Manager](https://techdocs.akamai.com/terraform/v6.1/docs/botman-datasources) | Identify, track, and respond to bot activity on your domain or in your app. | +| [Certificates](https://techdocs.akamai.com/terraform/v6.1/docs/cps-datasources) | Full life cycle management of SSL certificates for your ​Akamai​ CDN applications. | +| [Client Lists](https://techdocs.akamai.com/terraform/v6.1/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/v6.1/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/v6.1/docs/cl-datasources) | Solve specific business challenges using value-added apps that complement ​Akamai​'s core solutions. | +| [DataStream](https://techdocs.akamai.com/terraform/v6.1/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/v6.1/docs/edns-datasources) | Replace or augment your DNS infrastructure with a cloud-based authoritative DNS solution. | +| [EdgeWorkers](https://techdocs.akamai.com/terraform/v6.1/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/v6.1/docs/gtm-datasources) | Use load balancing to manage website and mobile performance demands. | +| [Identity and Access Management](https://techdocs.akamai.com/terraform/v6.1/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/v6.1/docs/ivm-datasources) | Automate image and video delivery optimizations for your website visitors. | +| [Network Lists](https://techdocs.akamai.com/terraform/v6.1/docs/nl-datasources) | Automate the creation, deployment, and management of lists used in ​Akamai​ security products. | +| [Property](https://techdocs.akamai.com/terraform/v6.1/docs/pm-datasources) | Define rules and behaviors that govern your website delivery based on match criteria. | diff --git a/docs/guides/get-started.md b/docs/guides/get-started.md index f4e25ef15..196091158 100644 --- a/docs/guides/get-started.md +++ b/docs/guides/get-started.md @@ -21,7 +21,7 @@ Your Akamai Terraform configuration starts with listing us as a required provide required_providers { akamai = { source = "akamai/akamai" - version = "6.0.0" + version = "6.1.0" } } } @@ -99,20 +99,20 @@ Use the table to find information about the subprovider you’re using. | Subprovider | Description | |----------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------| -| [Application Security](https://techdocs.akamai.com/terraform/v6.0/docs/configure-appsec) | Manage security configurations, security policies, match targets, rate policies, and firewall rules. | -| [Bot Manager](https://techdocs.akamai.com/terraform/v6.0/docs/set-up-botman) | Identify, track, and respond to bot activity on your domain or in your app. | -| [Certificates](https://techdocs.akamai.com/terraform/v6.0/docs/cps-integration-guide) | Full life cycle management of SSL certificates for your ​Akamai​ CDN applications. | -| [Client Lists](https://techdocs.akamai.com/terraform/v6.0/docs/set-up-client-lists) | 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/v6.0/docs/set-up-cloud-wrapper) | 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/v6.0/docs/set-up-cloudlets) | Solve specific business challenges using value-added apps that complement ​Akamai​'s core solutions. | -| [DataStream](https://techdocs.akamai.com/terraform/v6.0/docs/set-up-datastream) | Monitor activity on the ​Akamai​ platform and send live log data to a destination of your choice. | -| [Edge DNS](https://techdocs.akamai.com/terraform/v6.0/docs/set-up-edgedns) | Replace or augment your DNS infrastructure with a cloud-based authoritative DNS solution. | -| [EdgeWorkers](https://techdocs.akamai.com/terraform/v6.0/docs/set-up-edgeworkers) | Execute JavaScript functions at the edge to optimize site performance and customize web experiences. | -| [Global Traffic Management](https://techdocs.akamai.com/terraform/v6.0/docs/set-up-gtm) | Use load balancing to manage website and mobile performance demands. | -| [Identity and Access Management](https://techdocs.akamai.com/terraform/v6.0/docs/set-up-iam) | Create users and groups, and define policies that manage access to your Akamai applications. | -| [Image and Video Manager](https://techdocs.akamai.com/terraform/v6.0/docs/set-up-ivm) | Automate image and video delivery optimizations for your website visitors. | -| [Network Lists](https://techdocs.akamai.com/terraform/v6.0/docs/set-up-network-lists) | Automate the creation, deployment, and management of lists used in ​Akamai​ security products. | -| [Property](https://techdocs.akamai.com/terraform/v6.0/docs/set-up-property-provisioning) | Define rules and behaviors that govern your website delivery based on match criteria. | +| [Application Security](https://techdocs.akamai.com/terraform/v6.1/docs/configure-appsec) | Manage security configurations, security policies, match targets, rate policies, and firewall rules. | +| [Bot Manager](https://techdocs.akamai.com/terraform/v6.1/docs/set-up-botman) | Identify, track, and respond to bot activity on your domain or in your app. | +| [Certificates](https://techdocs.akamai.com/terraform/v6.1/docs/cps-integration-guide) | Full life cycle management of SSL certificates for your ​Akamai​ CDN applications. | +| [Client Lists](https://techdocs.akamai.com/terraform/v6.1/docs/set-up-client-lists) | 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/v6.1/docs/set-up-cloud-wrapper) | 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/v6.1/docs/set-up-cloudlets) | Solve specific business challenges using value-added apps that complement ​Akamai​'s core solutions. | +| [DataStream](https://techdocs.akamai.com/terraform/v6.1/docs/set-up-datastream) | Monitor activity on the ​Akamai​ platform and send live log data to a destination of your choice. | +| [Edge DNS](https://techdocs.akamai.com/terraform/v6.1/docs/set-up-edgedns) | Replace or augment your DNS infrastructure with a cloud-based authoritative DNS solution. | +| [EdgeWorkers](https://techdocs.akamai.com/terraform/v6.1/docs/set-up-edgeworkers) | Execute JavaScript functions at the edge to optimize site performance and customize web experiences. | +| [Global Traffic Management](https://techdocs.akamai.com/terraform/v6.1/docs/set-up-gtm) | Use load balancing to manage website and mobile performance demands. | +| [Identity and Access Management](https://techdocs.akamai.com/terraform/v6.1/docs/set-up-iam) | Create users and groups, and define policies that manage access to your Akamai applications. | +| [Image and Video Manager](https://techdocs.akamai.com/terraform/v6.1/docs/set-up-ivm) | Automate image and video delivery optimizations for your website visitors. | +| [Network Lists](https://techdocs.akamai.com/terraform/v6.1/docs/set-up-network-lists) | Automate the creation, deployment, and management of lists used in ​Akamai​ security products. | +| [Property](https://techdocs.akamai.com/terraform/v6.1/docs/set-up-property-provisioning) | Define rules and behaviors that govern your website delivery based on match criteria. | ### Get contract and group IDs diff --git a/docs/index.md b/docs/index.md index 9308b1186..06884ad90 100644 --- a/docs/index.md +++ b/docs/index.md @@ -35,20 +35,20 @@ We’ve moved our documentation to the Akamai TechDocs site. Use the table to fi | Subprovider | Description | |----------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------| -| [Application Security](https://techdocs.akamai.com/terraform/v6.0/docs/configure-appsec) | Manage security configurations, security policies, match targets, rate policies, and firewall rules. | -| [Bot Manager](https://techdocs.akamai.com/terraform/v6.0/docs/set-up-botman) | Identify, track, and respond to bot activity on your domain or in your app. | -| [Certificates](https://techdocs.akamai.com/terraform/v6.0/docs/cps-integration-guide) | Full life cycle management of SSL certificates for your ​Akamai​ CDN applications. | -| [Client Lists](https://techdocs.akamai.com/terraform/v6.0/docs/set-up-client-lists) | 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/v6.0/docs/set-up-cloud-wrapper) | 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/v6.0/docs/set-up-cloudlets) | Solve specific business challenges using value-added apps that complement ​Akamai​'s core solutions. | -| [DataStream](https://techdocs.akamai.com/terraform/v6.0/docs/set-up-datastream) | Monitor activity on the ​Akamai​ platform and send live log data to a destination of your choice. | -| [Edge DNS](https://techdocs.akamai.com/terraform/v6.0/docs/set-up-edgedns) | Replace or augment your DNS infrastructure with a cloud-based authoritative DNS solution. | -| [EdgeWorkers](https://techdocs.akamai.com/terraform/v6.0/docs/set-up-edgeworkers) | Execute JavaScript functions at the edge to optimize site performance and customize web experiences. | -| [Global Traffic Management](https://techdocs.akamai.com/terraform/v6.0/docs/set-up-gtm) | Use load balancing to manage website and mobile performance demands. | -| [Identity and Access Management](https://techdocs.akamai.com/terraform/v6.0/docs/set-up-iam) | Create users and groups, and define policies that manage access to your Akamai applications. | -| [Image and Video Manager](https://techdocs.akamai.com/terraform/v6.0/docs/set-up-ivm) | Automate image and video delivery optimizations for your website visitors. | -| [Network Lists](https://techdocs.akamai.com/terraform/v6.0/docs/set-up-network-lists) | Automate the creation, deployment, and management of lists used in ​Akamai​ security products. | -| [Property](https://techdocs.akamai.com/terraform/v6.0/docs/set-up-property-provisioning) | Define rules and behaviors that govern your website delivery based on match criteria. | +| [Application Security](https://techdocs.akamai.com/terraform/v6.1/docs/configure-appsec) | Manage security configurations, security policies, match targets, rate policies, and firewall rules. | +| [Bot Manager](https://techdocs.akamai.com/terraform/v6.1/docs/set-up-botman) | Identify, track, and respond to bot activity on your domain or in your app. | +| [Certificates](https://techdocs.akamai.com/terraform/v6.1/docs/cps-integration-guide) | Full life cycle management of SSL certificates for your ​Akamai​ CDN applications. | +| [Client Lists](https://techdocs.akamai.com/terraform/v6.1/docs/set-up-client-lists) | 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/v6.1/docs/set-up-cloud-wrapper) | 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/v6.1/docs/set-up-cloudlets) | Solve specific business challenges using value-added apps that complement ​Akamai​'s core solutions. | +| [DataStream](https://techdocs.akamai.com/terraform/v6.1/docs/set-up-datastream) | Monitor activity on the ​Akamai​ platform and send live log data to a destination of your choice. | +| [Edge DNS](https://techdocs.akamai.com/terraform/v6.1/docs/set-up-edgedns) | Replace or augment your DNS infrastructure with a cloud-based authoritative DNS solution. | +| [EdgeWorkers](https://techdocs.akamai.com/terraform/v6.1/docs/set-up-edgeworkers) | Execute JavaScript functions at the edge to optimize site performance and customize web experiences. | +| [Global Traffic Management](https://techdocs.akamai.com/terraform/v6.1/docs/set-up-gtm) | Use load balancing to manage website and mobile performance demands. | +| [Identity and Access Management](https://techdocs.akamai.com/terraform/v6.1/docs/set-up-iam) | Create users and groups, and define policies that manage access to your Akamai applications. | +| [Image and Video Manager](https://techdocs.akamai.com/terraform/v6.1/docs/set-up-ivm) | Automate image and video delivery optimizations for your website visitors. | +| [Network Lists](https://techdocs.akamai.com/terraform/v6.1/docs/set-up-network-lists) | Automate the creation, deployment, and management of lists used in ​Akamai​ security products. | +| [Property](https://techdocs.akamai.com/terraform/v6.1/docs/set-up-property-provisioning) | Define rules and behaviors that govern your website delivery based on match criteria. | ## Links to resources diff --git a/docs/resources/resources.md b/docs/resources/resources.md index 6441fea54..a6eba7d88 100644 --- a/docs/resources/resources.md +++ b/docs/resources/resources.md @@ -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/v6.0/docs/appsec-resources) | Manage security configurations, security policies, match targets, rate policies, and firewall rules. | -| [Bot Manager](https://techdocs.akamai.com/terraform/v6.0/docs/botman-resources) | Identify, track, and respond to bot activity on your domain or in your app. | -| [Certificates](https://techdocs.akamai.com/terraform/v6.0/docs/cps-resources) | Full life cycle management of SSL certificates for your ​Akamai​ CDN applications. | -| [Client Lists](https://techdocs.akamai.com/terraform/v6.0/docs/cli-resources) |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/v6.0/docs/cw-resources) | 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/v6.0/docs/cl-resources) | Solve specific business challenges using value-added apps that complement ​Akamai​'s core solutions. | -| [DataStream](https://techdocs.akamai.com/terraform/v6.0/docs/ds-resources) | Monitor activity on the ​Akamai​ platform and send live log data to a destination of your choice. | -| [Edge DNS](https://techdocs.akamai.com/terraform/v6.0/docs/edns-resources) | Replace or augment your DNS infrastructure with a cloud-based authoritative DNS solution. | -| [EdgeWorkers](https://techdocs.akamai.com/terraform/v6.0/docs/ew-resources) | Execute JavaScript functions at the edge to optimize site performance and customize web experiences. | -| [Global Traffic Management](https://techdocs.akamai.com/terraform/v6.0/docs/gtm-resources) | Use load balancing to manage website and mobile performance demands. | -| [Identity and Access Management](https://techdocs.akamai.com/terraform/v6.0/docs/iam-resources) | Create users and groups, and define policies that manage access to your Akamai applications. | -| [Image and Video Manager](https://techdocs.akamai.com/terraform/v6.0/docs/ivm-resources) | Automate image and video delivery optimizations for your website visitors. | -| [Network Lists](https://techdocs.akamai.com/terraform/v6.0/docs/nl-resources) | Automate the creation, deployment, and management of lists used in ​Akamai​ security products. | -| [Property](https://techdocs.akamai.com/terraform/v6.0/docs/pm-resources) | Define rules and behaviors that govern your website delivery based on match criteria. | +| [Application Security](https://techdocs.akamai.com/terraform/v6.1/docs/appsec-resources) | Manage security configurations, security policies, match targets, rate policies, and firewall rules. | +| [Bot Manager](https://techdocs.akamai.com/terraform/v6.1/docs/botman-resources) | Identify, track, and respond to bot activity on your domain or in your app. | +| [Certificates](https://techdocs.akamai.com/terraform/v6.1/docs/cps-resources) | Full life cycle management of SSL certificates for your ​Akamai​ CDN applications. | +| [Client Lists](https://techdocs.akamai.com/terraform/v6.1/docs/cli-resources) |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/v6.1/docs/cw-resources) | 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/v6.1/docs/cl-resources) | Solve specific business challenges using value-added apps that complement ​Akamai​'s core solutions. | +| [DataStream](https://techdocs.akamai.com/terraform/v6.1/docs/ds-resources) | Monitor activity on the ​Akamai​ platform and send live log data to a destination of your choice. | +| [Edge DNS](https://techdocs.akamai.com/terraform/v6.1/docs/edns-resources) | Replace or augment your DNS infrastructure with a cloud-based authoritative DNS solution. | +| [EdgeWorkers](https://techdocs.akamai.com/terraform/v6.1/docs/ew-resources) | Execute JavaScript functions at the edge to optimize site performance and customize web experiences. | +| [Global Traffic Management](https://techdocs.akamai.com/terraform/v6.1/docs/gtm-resources) | Use load balancing to manage website and mobile performance demands. | +| [Identity and Access Management](https://techdocs.akamai.com/terraform/v6.1/docs/iam-resources) | Create users and groups, and define policies that manage access to your Akamai applications. | +| [Image and Video Manager](https://techdocs.akamai.com/terraform/v6.1/docs/ivm-resources) | Automate image and video delivery optimizations for your website visitors. | +| [Network Lists](https://techdocs.akamai.com/terraform/v6.1/docs/nl-resources) | Automate the creation, deployment, and management of lists used in ​Akamai​ security products. | +| [Property](https://techdocs.akamai.com/terraform/v6.1/docs/pm-resources) | Define rules and behaviors that govern your website delivery based on match criteria. | diff --git a/go.mod b/go.mod index ec39c6280..dcff68271 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/akamai/terraform-provider-akamai/v6 go 1.21 require ( - github.com/akamai/AkamaiOPEN-edgegrid-golang/v8 v8.0.0 + github.com/akamai/AkamaiOPEN-edgegrid-golang/v8 v8.1.0 github.com/allegro/bigcache/v2 v2.2.5 github.com/apex/log v1.9.0 github.com/dlclark/regexp2 v1.10.0 diff --git a/go.sum b/go.sum index 059f6ea47..7b5b7f786 100644 --- a/go.sum +++ b/go.sum @@ -6,8 +6,8 @@ github.com/ProtonMail/go-crypto v1.1.0-alpha.0 h1:nHGfwXmFvJrSR9xu8qL7BkO4DqTHXE github.com/ProtonMail/go-crypto v1.1.0-alpha.0/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE= github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7lmo= github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= -github.com/akamai/AkamaiOPEN-edgegrid-golang/v8 v8.0.0 h1:6/5z5SK2NvSsgu19vHfh2lurMPaE9fwvSB/VIBizFRo= -github.com/akamai/AkamaiOPEN-edgegrid-golang/v8 v8.0.0/go.mod h1:ytNNwwgBIEeWJJCWy57vbkkEaYiCxWrYU68B/F0Gi5g= +github.com/akamai/AkamaiOPEN-edgegrid-golang/v8 v8.1.0 h1:peKT873AjrueDF69cYQolgE2ehxCpOw/8py4F43iU/M= +github.com/akamai/AkamaiOPEN-edgegrid-golang/v8 v8.1.0/go.mod h1:ytNNwwgBIEeWJJCWy57vbkkEaYiCxWrYU68B/F0Gi5g= github.com/allegro/bigcache/v2 v2.2.5 h1:mRc8r6GQjuJsmSKQNPsR5jQVXc8IJ1xsW5YXUYMLfqI= github.com/allegro/bigcache/v2 v2.2.5/go.mod h1:FppZsIO+IZk7gCuj5FiIDHGygD9xvWQcqg1uIPMb6tY= github.com/andres-erbsen/clock v0.0.0-20160526145045-9e14626cd129 h1:MzBOUgng9orim59UnfUTLRjMpd09C5uEVQ6RPGeCaVI= diff --git a/pkg/providers/cps/resource_akamai_cps_upload_certificate.go b/pkg/providers/cps/resource_akamai_cps_upload_certificate.go index 8855d9f6b..4f96885fd 100644 --- a/pkg/providers/cps/resource_akamai_cps_upload_certificate.go +++ b/pkg/providers/cps/resource_akamai_cps_upload_certificate.go @@ -162,7 +162,9 @@ func resourceCPSUploadCertificateCreate(ctx context.Context, d *schema.ResourceD ctx = session.ContextWithOptions(ctx, session.WithContextLog(logger)) client := inst.Client(meta) logger.Debug("Creating upload certificate") - + if err := d.Set("unacknowledged_warnings", false); err != nil { + return diag.Errorf("could not set `unacknowledged_warnings`: %s", err) + } return upsertUploadCertificate(ctx, d, m, client, logger) } @@ -237,7 +239,9 @@ func resourceCPSUploadCertificateUpdate(ctx context.Context, d *schema.ResourceD ctx = session.ContextWithOptions(ctx, session.WithContextLog(logger)) client := inst.Client(meta) logger.Debug("Updating upload certificate") - + if err := d.Set("unacknowledged_warnings", false); err != nil { + return diag.Errorf("could not set `unacknowledged_warnings`: %s", err) + } enrollmentID, err := tf.GetIntValue("enrollment_id", d) if err != nil { return diag.Errorf("could not get `enrollment_id` attribute: %s", err) @@ -423,7 +427,7 @@ func checkUnacknowledgedWarnings(ctx context.Context, diff *schema.ResourceDiff, return err } if changeStatus.StatusInfo.Status == waitReviewThirdPartyCert || changeStatus.StatusInfo.Status == waitUploadThirdParty { - if err := diff.SetNewComputed("unacknowledged_warnings"); err != nil { + if err := diff.SetNew("unacknowledged_warnings", true); err != nil { return fmt.Errorf("could not set 'unacknowledged_warnings' attribute: %s", err) } } diff --git a/pkg/providers/dns/resource_akamai_dns_record.go b/pkg/providers/dns/resource_akamai_dns_record.go index c313b081c..07d5a4193 100644 --- a/pkg/providers/dns/resource_akamai_dns_record.go +++ b/pkg/providers/dns/resource_akamai_dns_record.go @@ -1894,19 +1894,35 @@ func newRecordCreate(ctx context.Context, meta meta.Meta, d *schema.ResourceData if err != nil && !errors.Is(err, tf.ErrNotFound) { return dns.RecordBody{}, err } + doSort := false for _, recContent := range target { recContentStr, ok := recContent.(string) if !ok { return dns.RecordBody{}, fmt.Errorf("record is of invalid type; should be 'string'") } - record := strconv.Itoa(priority) + " " + strconv.Itoa(weight) + " " + strconv.Itoa(port) + " " + recContentStr + entryparts := strings.Split(recContentStr, " ") + if len(entryparts) != 1 && len(entryparts) != 4 { + return dns.RecordBody{}, fmt.Errorf("RData shcould consist of 1 part or 4 parts separated with ' '") + } + var record string + // if target has no priority, weight and port provided, use default values + if len(entryparts) == 1 { + record = strconv.Itoa(priority) + " " + strconv.Itoa(weight) + " " + strconv.Itoa(port) + " " + recContentStr + doSort = true + } + if len(entryparts) == 4 { + record = recContentStr + } + if !strings.HasSuffix(recContentStr, ".") { record += "." } records = append(records, record) } - sort.Strings(records) + if doSort { + sort.Strings(records) + } recordCreate = dns.RecordBody{Name: host, RecordType: recordType, TTL: ttl, Target: records} case RRTypeSshfp: @@ -2198,6 +2214,39 @@ func checkTargets(d *schema.ResourceData) error { return nil } +func isSRVTargetOldFormat(d *schema.ResourceData) (bool, error) { + target, err := tf.GetListValue("target", d) + if err != nil && !errors.Is(err, tf.ErrNotFound) { + return false, err + } + if len(target) == 0 { + return false, fmt.Errorf("configuration argument target must be set") + } + simple, complete := 0, 0 + for _, recContent := range target { + t, ok := recContent.(string) + if !ok { + return false, fmt.Errorf("target record is of invalid type; should be 'string'") + } + parts := strings.Split(t, " ") + switch len(parts) { + case 1: + simple++ + case 4: + complete++ + default: + return false, fmt.Errorf("target should consist of 1 part or 4 parts separated with ' '") + } + } + if simple > 0 && complete > 0 { + return false, fmt.Errorf("target should consist of only simple or complete items") + } + if simple > 0 { + return true, nil + } + return false, nil +} + func checkAsdfRecord(d *schema.ResourceData) error { subtype, err := tf.GetIntValue("subtype", d) if err != nil && !errors.Is(err, tf.ErrNotFound) { @@ -2606,20 +2655,37 @@ func checkSrvRecord(d *schema.ResourceData) error { return err } - if err := checkTargets(d); err != nil { + var required bool + if required, err = isSRVTargetOldFormat(d); err != nil { return err } - if priority < 0 || priority > 65535 { - return fmt.Errorf("configuration argument priority must be set for SRV") - } + // when required, provide valid values + if required { + if priority < 0 || priority > 65535 { + return fmt.Errorf("configuration argument priority must be set for SRV") + } - if weight < 0 || weight > 65535 { - return fmt.Errorf("configuration argument weight must not be %v for SRV", weight) - } + if weight < 0 || weight > 65535 { + return fmt.Errorf("configuration argument weight must not be %v for SRV", weight) + } + + if port == 0 { + return fmt.Errorf("configuration argument port must be set for SRV") + } + } else { + // when not required, we should not provide them + if priority != 0 { + return fmt.Errorf("configuration argument priority must not be set for SRV") + } + + if weight != 0 { + return fmt.Errorf("configuration argument weight must not be set for SRV") + } - if port == 0 { - return fmt.Errorf("configuration argument port must be set for SRV") + if port != 0 { + return fmt.Errorf("configuration argument port must not be set for SRV") + } } return nil diff --git a/pkg/providers/dns/resource_akamai_dns_record_test.go b/pkg/providers/dns/resource_akamai_dns_record_test.go index dcf84da71..ffd09ddda 100644 --- a/pkg/providers/dns/resource_akamai_dns_record_test.go +++ b/pkg/providers/dns/resource_akamai_dns_record_test.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "net/http" + "regexp" "strings" "testing" @@ -204,6 +205,220 @@ func TestResDnsRecord(t *testing.T) { client.AssertExpectations(t) }) + + t.Run("SRV record test with default values", func(t *testing.T) { + client := &dns.Mock{} + + targetBig := "10 60 5060 big.example.com." + targetSmall := "10 60 5060 small.example.com." + targetTiny := "10 60 5060 tiny.example.com." + + client.On("GetRecord", + mock.Anything, + "origin.org", + "origin.example.org", + "SRV", + ).Return(nil, notFound).Once() + + client.On("CreateRecord", + mock.Anything, + &dns.RecordBody{ + Name: "origin.example.org", + RecordType: "SRV", + TTL: 300, + Active: false, + Target: []string{targetBig, targetSmall, targetTiny}, + }, + "origin.org", + []bool{false}, + ).Return(nil) + + client.On("GetRecord", + mock.Anything, + "origin.org", + "origin.example.org", + "SRV", + ).Return(&dns.RecordBody{ + Name: "origin.example.org", + RecordType: "SRV", + TTL: 300, + Active: false, + Target: []string{targetBig, targetSmall, targetTiny}, + }, nil).Once() + + c := dns.Client(session.Must(session.New())) + + client.On("ParseRData", + mock.Anything, + "SRV", + []string{targetBig, targetSmall, targetTiny}, + ).Return( + c.ParseRData(context.Background(), "SRV", []string{targetBig, targetSmall, targetTiny}), + ).Times(2) + + client.On("ProcessRdata", + mock.Anything, + []string{targetBig, targetSmall, targetTiny}, + "SRV", + ).Return([]string{targetBig, targetSmall, targetTiny}).Times(2) + + client.On("GetRecord", + mock.Anything, + "origin.org", + "origin.example.org", + "SRV", + ).Return(&dns.RecordBody{ + Name: "origin.example.org", + RecordType: "SRV", + TTL: 300, + Active: false, + Target: []string{targetBig, targetSmall, targetTiny}, + }, nil).Once() + + client.On("DeleteRecord", + mock.Anything, + mock.AnythingOfType("*dns.RecordBody"), + mock.AnythingOfType("string"), + mock.AnythingOfType("[]bool"), + ).Return(nil) + + resourceName := "akamai_dns_record.srv_record" + + useClient(client, func() { + resource.UnitTest(t, resource.TestCase{ + ProtoV6ProviderFactories: testutils.NewProtoV6ProviderFactory(NewSubprovider()), + Steps: []resource.TestStep{ + { + Config: testutils.LoadFixtureString(t, "testdata/TestResDnsRecord/create_basic_srv_default.tf"), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(resourceName, "recordtype", "SRV"), + resource.TestCheckResourceAttr(resourceName, "target.#", "3"), + resource.TestCheckResourceAttr(resourceName, "target.0", "big.example.com."), + resource.TestCheckResourceAttr(resourceName, "target.1", "small.example.com."), + resource.TestCheckResourceAttr(resourceName, "target.2", "tiny.example.com."), + ), + }, + }, + }) + }) + + client.AssertExpectations(t) + }) + t.Run("SRV record test without default values", func(t *testing.T) { + client := &dns.Mock{} + + targetBig := "10 60 5060 big.example.com." + targetSmall := "10 40 5060 small.example.com." + targetTiny := "20 100 5060 tiny.example.com." + + client.On("GetRecord", + mock.Anything, + "origin.org", + "origin.example.org", + "SRV", + ).Return(nil, notFound).Once() + + client.On("CreateRecord", + mock.Anything, + &dns.RecordBody{ + Name: "origin.example.org", + RecordType: "SRV", + TTL: 300, + Active: false, + Target: []string{targetBig, targetSmall, targetTiny}, + }, + "origin.org", + []bool{false}, + ).Return(nil) + + client.On("GetRecord", + mock.Anything, + "origin.org", + "origin.example.org", + "SRV", + ).Return(&dns.RecordBody{ + Name: "origin.example.org", + RecordType: "SRV", + TTL: 300, + Active: false, + Target: []string{targetBig, targetSmall, targetTiny}, + }, nil).Once() + + c := dns.Client(session.Must(session.New())) + + client.On("ParseRData", + mock.Anything, + "SRV", + []string{targetBig, targetSmall, targetTiny}, + ).Return( + c.ParseRData(context.Background(), "SRV", []string{targetBig, targetSmall, targetTiny}), + ).Times(2) + + client.On("ProcessRdata", + mock.Anything, + []string{targetBig, targetSmall, targetTiny}, + "SRV", + ).Return([]string{targetBig, targetSmall, targetTiny}).Times(2) + + client.On("GetRecord", + mock.Anything, + "origin.org", + "origin.example.org", + "SRV", + ).Return(&dns.RecordBody{ + Name: "origin.example.org", + RecordType: "SRV", + TTL: 300, + Active: false, + Target: []string{targetBig, targetSmall, targetTiny}, + }, nil).Once() + + client.On("DeleteRecord", + mock.Anything, + mock.AnythingOfType("*dns.RecordBody"), + mock.AnythingOfType("string"), + mock.AnythingOfType("[]bool"), + ).Return(nil) + + resourceName := "akamai_dns_record.srv_record" + + useClient(client, func() { + resource.UnitTest(t, resource.TestCase{ + ProtoV6ProviderFactories: testutils.NewProtoV6ProviderFactory(NewSubprovider()), + Steps: []resource.TestStep{ + { + Config: testutils.LoadFixtureString(t, "testdata/TestResDnsRecord/create_basic_srv_no_default.tf"), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(resourceName, "recordtype", "SRV"), + resource.TestCheckResourceAttr(resourceName, "target.#", "3"), + resource.TestCheckResourceAttr(resourceName, "target.0", "10 60 5060 big.example.com."), + resource.TestCheckResourceAttr(resourceName, "target.1", "10 40 5060 small.example.com."), + resource.TestCheckResourceAttr(resourceName, "target.2", "20 100 5060 tiny.example.com."), + ), + }, + }, + }) + }) + + client.AssertExpectations(t) + }) + t.Run("SRV record test with invalid mixed values", func(t *testing.T) { + client := &dns.Mock{} + + useClient(client, func() { + resource.UnitTest(t, resource.TestCase{ + ProtoV6ProviderFactories: testutils.NewProtoV6ProviderFactory(NewSubprovider()), + Steps: []resource.TestStep{ + { + Config: testutils.LoadFixtureString(t, "testdata/TestResDnsRecord/create_basic_srv_mix_invalid.tf"), + ExpectError: regexp.MustCompile("target should consist of only simple or complete items"), + }, + }, + }) + }) + + client.AssertExpectations(t) + }) } func TestTargetDiffSuppress(t *testing.T) { diff --git a/pkg/providers/dns/testdata/TestResDnsRecord/create_basic_srv_default.tf b/pkg/providers/dns/testdata/TestResDnsRecord/create_basic_srv_default.tf new file mode 100644 index 000000000..a992db9c8 --- /dev/null +++ b/pkg/providers/dns/testdata/TestResDnsRecord/create_basic_srv_default.tf @@ -0,0 +1,19 @@ +provider "akamai" { + edgerc = "../../common/testutils/edgerc" +} + +resource "akamai_dns_record" "srv_record" { + zone = "origin.org" + name = "origin.example.org" + recordtype = "SRV" + active = true + ttl = 300 + priority = 10 + weight = 60 + port = 5060 + target = [ + "big.example.com", + "small.example.com", + "tiny.example.com" + ] +} diff --git a/pkg/providers/dns/testdata/TestResDnsRecord/create_basic_srv_mix_invalid.tf b/pkg/providers/dns/testdata/TestResDnsRecord/create_basic_srv_mix_invalid.tf new file mode 100644 index 000000000..5e758ff6b --- /dev/null +++ b/pkg/providers/dns/testdata/TestResDnsRecord/create_basic_srv_mix_invalid.tf @@ -0,0 +1,19 @@ +provider "akamai" { + edgerc = "../../common/testutils/edgerc" +} + +resource "akamai_dns_record" "srv_record" { + zone = "origin.org" + name = "origin.example.org" + recordtype = "SRV" + active = true + ttl = 300 + priority = 10 + weight = 60 + port = 5060 + target = [ + "big.example.com", + "small.example.com", + "20 50 5060 tiny.example.com" + ] +} diff --git a/pkg/providers/dns/testdata/TestResDnsRecord/create_basic_srv_no_default.tf b/pkg/providers/dns/testdata/TestResDnsRecord/create_basic_srv_no_default.tf new file mode 100644 index 000000000..12e57713a --- /dev/null +++ b/pkg/providers/dns/testdata/TestResDnsRecord/create_basic_srv_no_default.tf @@ -0,0 +1,16 @@ +provider "akamai" { + edgerc = "../../common/testutils/edgerc" +} + +resource "akamai_dns_record" "srv_record" { + zone = "origin.org" + name = "origin.example.org" + recordtype = "SRV" + active = true + ttl = 300 + target = [ + "10 60 5060 big.example.com", + "10 40 5060 small.example.com", + "20 100 5060 tiny.example.com" + ] +} diff --git a/pkg/providers/imaging/imagewriter/convert-image.gen.go b/pkg/providers/imaging/imagewriter/convert-image.gen.go index a448a62bd..e95316a09 100644 --- a/pkg/providers/imaging/imagewriter/convert-image.gen.go +++ b/pkg/providers/imaging/imagewriter/convert-image.gen.go @@ -734,6 +734,22 @@ func getShear(d *schema.ResourceData, key string) *imaging.Shear { return nil } +func getSmartCrop(d *schema.ResourceData, key string) *imaging.SmartCrop { + _, exist := extract(d, key) + if exist { + result := imaging.SmartCrop{ + Debug: booleanVariableInline(d, getKey(key, 0, "debug")), + Height: integerVariableInline(d, getKey(key, 0, "height")), + Sloppy: booleanVariableInline(d, getKey(key, 0, "sloppy")), + Style: smartCropStyleVariableInline(d, getKey(key, 0, "style")), + Width: integerVariableInline(d, getKey(key, 0, "width")), + Transformation: imaging.SmartCropTransformationSmartCrop, + } + return &result + } + return nil +} + func getTextImageType(d *schema.ResourceData, key string) *imaging.TextImageType { _, exist := extract(d, key) if exist { @@ -1094,6 +1110,10 @@ func getTransformationType(d *schema.ResourceData, key string) imaging.Transform if exist { return getShear(d, key+".shear") } + _, exist = extract(d, key+".smart_crop") + if exist { + return getSmartCrop(d, key+".smart_crop") + } _, exist = extract(d, key+".trim") if exist { return getTrim(d, key+".trim") @@ -1658,6 +1678,32 @@ func resizeTypeVariableInline(d *schema.ResourceData, key string) *imaging.Resiz return nil } +func smartCropStyleVariableInline(d *schema.ResourceData, key string) *imaging.SmartCropStyleVariableInline { + var value *imaging.SmartCropStyle + var name *string + + valueRaw, existVal := extract(d, key) + existVal = existVal && valueRaw.(string) != "" + if existVal { + value = imaging.SmartCropStylePtr(imaging.SmartCropStyle(valueRaw.(string))) + } + + nameRaw, existVar := extract(d, key+"_var") + existVar = existVar && nameRaw.(string) != "" + if existVar { + name = ptr.To(nameRaw.(string)) + } + + if existVal || existVar { + return &imaging.SmartCropStyleVariableInline{ + Name: name, + Value: value, + } + } + + return nil +} + func booleanVariableInline(d *schema.ResourceData, key string) *imaging.BooleanVariableInline { var value *bool var name *string diff --git a/pkg/providers/imaging/policy_image.gen.go b/pkg/providers/imaging/policy_image.gen.go index 3b024a7fb..0fad1e0a1 100644 --- a/pkg/providers/imaging/policy_image.gen.go +++ b/pkg/providers/imaging/policy_image.gen.go @@ -422,6 +422,15 @@ func transformationType(depth int) map[string]*schema.Schema { }, }, + "smart_crop": { + Description: "Crops around whatever is most important in the image, to a region around a specified area of interest relative to the specified `width` and `height` values. The crop detects any faces present, otherwise features.", + Type: schema.TypeList, + Optional: true, + Elem: &schema.Resource{ + Schema: smartCrop(depth - 1), + }, + }, + "trim": { Description: "Automatically crops uniform backgrounds from the edges of an image.", Type: schema.TypeList, @@ -2473,6 +2482,66 @@ func shear(_ int) map[string]*schema.Schema { } } +func smartCrop(_ int) map[string]*schema.Schema { + return map[string]*schema.Schema{ + "debug": { + Type: schema.TypeString, + Optional: true, + Description: "When enabled, the SmartCrop transformation doesn't actually execute. Instead, it outlines found faces or features, the region of interest, and the crop area.", + ValidateDiagFunc: validateIsTypeBool(), + }, + "debug_var": { + Type: schema.TypeString, + Optional: true, + Description: "When enabled, the SmartCrop transformation doesn't actually execute. Instead, it outlines found faces or features, the region of interest, and the crop area.", + }, + "height": { + Type: schema.TypeString, + Optional: true, + Description: "The height in pixels of the output image relative to the specified `style` value.", + ValidateDiagFunc: validateIsTypeInt(), + }, + "height_var": { + Type: schema.TypeString, + Optional: true, + Description: "The height in pixels of the output image relative to the specified `style` value.", + }, + "sloppy": { + Type: schema.TypeString, + Optional: true, + Description: "Whether to sacrifice any image fidelity for transformation performance.", + ValidateDiagFunc: validateIsTypeBool(), + }, + "sloppy_var": { + Type: schema.TypeString, + Optional: true, + Description: "Whether to sacrifice any image fidelity for transformation performance.", + }, + "style": { + Type: schema.TypeString, + Optional: true, + Description: "Specifies how to crop or scale a crop area for the specified area of interest in the source image, `fill` by default. The output image resizes to the specified `width` and `height` values. A value of `crop` places raw crop around the point of interest. A value of `fill` scales the crop area to include as much of the image and point of interest as possible, relative to the specified `width` and `height` values. A value of `zoom` scales the crop area as small as possible to fit the point of interest, relative to the specified `width` and `height` values.", + ValidateDiagFunc: validation.ToDiagFunc(validation.StringInSlice([]string{"crop", "fill", "zoom"}, false)), + }, + "style_var": { + Type: schema.TypeString, + Optional: true, + Description: "Specifies how to crop or scale a crop area for the specified area of interest in the source image, `fill` by default. The output image resizes to the specified `width` and `height` values. A value of `crop` places raw crop around the point of interest. A value of `fill` scales the crop area to include as much of the image and point of interest as possible, relative to the specified `width` and `height` values. A value of `zoom` scales the crop area as small as possible to fit the point of interest, relative to the specified `width` and `height` values.", + }, + "width": { + Type: schema.TypeString, + Optional: true, + Description: "The width in pixels of the output image relative to the specified `style` value.", + ValidateDiagFunc: validateIsTypeInt(), + }, + "width_var": { + Type: schema.TypeString, + Optional: true, + Description: "The width in pixels of the output image relative to the specified `style` value.", + }, + } +} + func textImageType(depth int) map[string]*schema.Schema { return map[string]*schema.Schema{ "fill": {