When using the Terraform Anypoint Provider to define or import Flex Gateway API instances, you may observe that the `upstream` or `spec.services.back-end.address` configuration is not correctly applied or recognized by the Flex Gateway. Even when explicitly defined in your Terraform configuration, the deployed API instance may lack the intended upstream details. The Terraform apply operation typically completes without errors, but the expected upstream configuration is absent upon inspection of the Flex Gateway API instance.
CAUSE
This behavior is caused by a defect in versions of the Terraform Anypoint Provider prior to 1.0.3. These earlier versions contained a bug that prevented the correct processing and application of the upstream URL configuration when creating or updating Flex Gateway API instances. As a result, the upstream details specified in your Terraform configuration were not properly translated and applied to the Flex Gateway.
SOLUTION
To resolve this issue, upgrade your Terraform Anypoint Provider to version 1.0.3 or later. This version includes the necessary fix to correctly handle upstream configurations for Flex Gateway API instances.
1. **Update your Terraform provider configuration**:
Modify your `versions.tf` or provider block to specify version `1.0.3` or a later compatible version for the Anypoint Provider.
```terraform
terraform {
required_providers {
anypoint = {
source = "mulesoft/anypoint"
version = "~> 1.0.3" # Or a later compatible version
}
}
}
```
2. **Initialize and upgrade Terraform providers**:
Navigate to your Terraform project directory in your terminal and run the following command to re-initialize your working directory and upgrade the provider:
```bash
terraform init -upgrade
```
3. **Apply your Terraform configuration**:
After the provider has been upgraded, apply your Terraform configuration to ensure the upstream details are correctly provisioned:
```bash
terraform apply
```
Confirm the changes when prompted.
After these steps, the Flex Gateway API instance should correctly reflect the upstream URL as defined in your Terraform configuration.
APPLIES TO
* Terraform Anypoint Provider versions prior to 1.0.3
* Flex Gateway API instances
005386567

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.