Skip to content

Commit

Permalink
Release 1.0.0 🎉
Browse files Browse the repository at this point in the history
  • Loading branch information
mheap committed Sep 11, 2024
1 parent fb914c0 commit 7d0b771
Show file tree
Hide file tree
Showing 364 changed files with 2,323 additions and 47,052 deletions.
4 changes: 2 additions & 2 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ management:
docVersion: 2.0.0
speakeasyVersion: 1.378.0
generationVersion: 2.404.3
releaseVersion: 0.7.0
configChecksum: c96af4be4b7f2e42863235ae20e37699
releaseVersion: 1.0.0
configChecksum: 5308088a6cc8195d6daf42c732dcaf2d
features:
terraform:
additionalDependencies: 0.1.0
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 1.0.0
> Released on 2024/09/11
### Features

* Released `terraform-provider-konnect` as GA 🎉

## 0.7.0
> Released on 2024/09/11
Expand Down
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ speakeasy: check-speakeasy
@git checkout -- README.md examples/README.md
@rm USAGE.md

FILES=$(shell find internal/provider -type f | grep data_source | grep -v portallist | grep -v cloudgatewayprovideraccountlist)
remove-data-sources:
@if [ -n "$(FILES)" ]; then rm $(FILES); fi
@rm -r examples/data-sources

check-speakeasy:
@command -v speakeasy >/dev/null 2>&1 || { echo >&2 "speakeasy CLI is not installed. Please install before continuing."; exit 1; }

Expand Down
68 changes: 3 additions & 65 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# terraform-provider-konnect

> This provider is available as a [BETA](https://docs.konghq.com/konnect/availability-stages/#beta) release.
This repository contains a Terraform provider for [Kong Konnect](https://konghq.com/products/kong-konnect/register?utm_source=github&utm_campaign=terraform&utm_content=terraform-provider-konnect).

## Capabilities
Expand Down Expand Up @@ -29,36 +27,7 @@ This provider can manage the following resources:
- Service
- Route
- Plugins
- ACL
- AI Prompt Decorator
- AI Prompt Guard
- AI Prompt Template
- AI Proxy
- AWS Lambda
- Basic Auth
- Correlation ID
- CORS
- File Log
- IP Restriction
- JQ
- JWT
- JWT Signer
- KeyAuth
- OAuth2
- OpenID Connect
- OpenTelemetry
- Pre-function
- Prometheus
- Proxy Cache
- Rate Limiting
- Rate Limiting Advanced
- Request Termination
- Request Transformer
- Request Transformer Advanced
- Response Transformer
- Response Transformer Advanced
- SAML
- Exit Transformer
- Custom Plugins
- Consumers
- Consumer Groups
- Consumer Group Members
Expand Down Expand Up @@ -136,42 +105,11 @@ e.g. `KONNECT_TOKEN=kpat_YOUR_PAT terraform apply`

## Examples

The examples directory contains sample usage for all supported resources. For a full list of supported parameters for each resource, see the [Konnect API documentation](https://docs.konghq.com/api/).

The examples will reference resources that are expected to exist in your manifests e.g. `konnect_gateway_control_plane.tfdemo.id`. Update the references to match the names that you have given your resources.

### OneOf resources
The examples directory contains sample usage for all supported resources. For a full list of supported parameters for each resource, see the [provider documentation](https://registry.terraform.io/providers/Kong/konnect/latest/docs).

When a resource has multiple representations the configuration must be placed inside a key that identifies which schema you want to use.

Let's work through a concrete example.

The `konnect_application_auth_strategy` resource supports multiple authentication strategies. The API specification marks `strategy_type` as the discriminator, which is how the API figures out which schema it should use for validation.

This means that the `konnect_application_auth_strategy` resource has a sub key that matches the values in `strategy_type`. If `strategy_type` is `key_auth`, the resource looks like the following:

```hcl
resource "konnect_application_auth_strategy" "my_applicationauthstrategy" {
key_auth = {
name = "my-application-auth-strategy"
# Other parameters omitted
}
}
```

## FAQ

### Why do you only support specific plugins?

Kong Gateway's plugin entity supports any JSON blob in the `config` field, and will automatically fill in any default values. This does not work well with Terraform, which requires a predefined schema in order to track default values in the state file.

In order to support idempotent plan and apply operations, this provider has one resource per plugin.

If you require a plugin that is not currently supported, please open an issue.
The examples in this repo reference resources that are expected to exist in your manifests e.g. `konnect_gateway_control_plane.tfdemo.id`. Update the references to match the names that you have given your resources.

<!-- No SDK Installation -->
<!-- No SDK Example Usage -->
<!-- No SDK Available Operations -->
<!-- Placeholder for Future Speakeasy SDK Sections -->


54 changes: 54 additions & 0 deletions docs/data-sources/cloud_gateway_provider_account_list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "konnect_cloud_gateway_provider_account_list Data Source - terraform-provider-konnect"
subcategory: ""
description: |-
CloudGatewayProviderAccountList DataSource
---

# konnect_cloud_gateway_provider_account_list (Data Source)

CloudGatewayProviderAccountList DataSource



<!-- schema generated by tfplugindocs -->
## Schema

### Optional

- `page_number` (Number) Determines which page of the entities to retrieve.
- `page_size` (Number) The maximum number of items to include per page. The last page of a collection may include fewer items.

### Read-Only

- `data` (Attributes List) (see [below for nested schema](#nestedatt--data))
- `meta` (Attributes) returns the pagination information (see [below for nested schema](#nestedatt--meta))

<a id="nestedatt--data"></a>
### Nested Schema for `data`

Read-Only:

- `created_at` (String) An RFC-3339 timestamp representation of provider account creation date.
- `id` (String)
- `provider` (String) Name of cloud provider. must be one of ["aws"]
- `provider_account_id` (String) ID of the cloud provider account.
- `updated_at` (String) An RFC-3339 timestamp representation of provider account update date.


<a id="nestedatt--meta"></a>
### Nested Schema for `meta`

Read-Only:

- `page` (Attributes) Contains pagination query parameters and the total number of objects returned. (see [below for nested schema](#nestedatt--meta--page))

<a id="nestedatt--meta--page"></a>
### Nested Schema for `meta.page`

Read-Only:

- `number` (Number)
- `size` (Number)
- `total` (Number)
81 changes: 81 additions & 0 deletions docs/data-sources/portal_list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "konnect_portal_list Data Source - terraform-provider-konnect"
subcategory: ""
description: |-
PortalList DataSource
---

# konnect_portal_list (Data Source)

PortalList DataSource



<!-- schema generated by tfplugindocs -->
## Schema

### Optional

- `page_number` (Number) Determines which page of the entities to retrieve.
- `page_size` (Number) The maximum number of items to include per page. The last page of a collection may include fewer items.
- `sort` (String) Sorts a collection of portals. Supported sort attributes are:
- name
- description
- is_public
- rbac_enabled
- auto_approve_applications
- auto_approve_developers
- default_domain
- custom_domain
- custom_client_domain
- created_at
- updated_at

### Read-Only

- `data` (Attributes List) (see [below for nested schema](#nestedatt--data))
- `meta` (Attributes) returns the pagination information (see [below for nested schema](#nestedatt--meta))

<a id="nestedatt--data"></a>
### Nested Schema for `data`

Read-Only:

- `application_count` (Number) Number of applications created in the portal.
- `auto_approve_applications` (Boolean) Whether the requests from applications to register for products will be automatically approved, or if they will be set to pending until approved by an admin.
- `auto_approve_developers` (Boolean) Whether the developer account registrations will be automatically approved, or if they will be set to pending until approved by an admin.
- `created_at` (String) An ISO-8601 timestamp representation of entity creation date.
- `custom_client_domain` (String) The custom domain to access a self-hosted customized developer portal client. If this is set, the Konnect-hosted portal client will no longer be available. `custom_domain` must be also set for this value to be set. See https://github.com/Kong/konnect-portal for information on how to get started deploying and customizing your own Konnect portal.
- `custom_domain` (String) The custom domain to access the developer portal. A CNAME for the portal's default domain must be able to be set for the custom domain for it to be valid. After setting a valid CNAME, an SSL/TLS certificate will be automatically manged for the custom domain, and traffic will be able to use the custom domain to route to the portal's web client and API.
- `default_application_auth_strategy_id` (String) Default strategy ID applied on applications for the portal
- `default_domain` (String) The domain assigned to the portal by Konnect. This is the default place to access the portal and its API if not using a `custom_domain``.
- `description` (String) The description of the portal.
- `developer_count` (Number) Number of developers using the portal.
- `display_name` (String) The display name of the portal. This value will be the portal's `name` in Portal API.
- `id` (String) Contains a unique identifier used for this resource.
- `is_public` (Boolean) Whether the portal catalog can be accessed publicly without any developer authentication. Developer accounts and applications cannot be created if the portal is public.
- `labels` (Map of String) Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types.

Keys must be of length 1-63 characters, and cannot start with "kong", "konnect", "mesh", "kic", or "_".
- `name` (String) The name of the portal, used to distinguish it from other portals. Name must be unique.
- `published_product_count` (Number) Number of api products published to the portal
- `rbac_enabled` (Boolean) Whether the portal resources are protected by Role Based Access Control (RBAC). If enabled, developers view or register for products until unless assigned to teams with access to view and consume specific products.
- `updated_at` (String) An ISO-8601 timestamp representation of entity update date.


<a id="nestedatt--meta"></a>
### Nested Schema for `meta`

Read-Only:

- `page` (Attributes) Contains pagination query parameters and the total number of objects returned. (see [below for nested schema](#nestedatt--meta--page))

<a id="nestedatt--meta--page"></a>
### Nested Schema for `meta.page`

Read-Only:

- `number` (Number)
- `size` (Number)
- `total` (Number)
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ terraform {
required_providers {
konnect = {
source = "kong/konnect"
version = "0.7.0"
version = "1.0.0"
}
}
}
Expand Down
20 changes: 19 additions & 1 deletion docs/resources/api_product.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,17 @@ description: |-

APIProduct Resource


## Example Usage

```terraform
resource "konnect_api_product" "my_apiproduct" {
description = "Text describing the API product"
name = "My Name"
portal_ids = [
"25a2624c-49fc-4764-99e1-224ed819f200",
]
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down Expand Up @@ -42,3 +52,11 @@ Read-Only:

- `portal_id` (String)
- `portal_name` (String)

## Import

Import is supported using the following syntax:

```shell
terraform import konnect_api_product.my_konnect_api_product "d32d905a-ed33-46a3-a093-d8f536af9a8a"
```
21 changes: 20 additions & 1 deletion docs/resources/api_product_document.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,18 @@ description: |-

APIProductDocument Resource


## Example Usage

```terraform
resource "konnect_api_product_document" "my_apiproductdocument" {
api_product_id = "d32d905a-ed33-46a3-a093-d8f536af9a8a"
content = "## My Markdown"
parent_document_id = "dd4e1b98-3629-4dd3-acc0-759a726ffee2"
slug = "path-for-seo"
status = "published"
title = "How to create a document in Konnect DocumentHub"
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand All @@ -36,3 +47,11 @@ APIProductDocument Resource

<a id="nestedatt--metadata"></a>
### Nested Schema for `metadata`

## Import

Import is supported using the following syntax:

```shell
terraform import konnect_api_product_document.my_konnect_api_product_document "{ \"api_product_id\": \"d32d905a-ed33-46a3-a093-d8f536af9a8a\", \"id\": \"de5c9818-be5c-42e6-b514-e3d4bc30ddeb\"}"
```
20 changes: 19 additions & 1 deletion docs/resources/api_product_specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,17 @@ description: |-

APIProductSpecification Resource


## Example Usage

```terraform
resource "konnect_api_product_specification" "my_apiproductspecification" {
api_product_id = "d32d905a-ed33-46a3-a093-d8f536af9a8a"
api_product_version_id = "9f5061ce-78f6-4452-9108-ad7c02821fd5"
content = "My YAML or JSON formatted OAS content"
name = "oas.yaml"
specification_id = "742ff9f1-fb89-4aeb-a599-f0e278c7aeaa"
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand All @@ -27,3 +37,11 @@ APIProductSpecification Resource
- `created_at` (String) An ISO-8601 timestamp representation of entity creation date.
- `id` (String) The API product version specification identifier.
- `updated_at` (String) An ISO-8601 timestamp representation of entity update date.

## Import

Import is supported using the following syntax:

```shell
terraform import konnect_api_product_specification.my_konnect_api_product_specification "{ \"api_product_id\": \"d32d905a-ed33-46a3-a093-d8f536af9a8a\", \"api_product_version_id\": \"9f5061ce-78f6-4452-9108-ad7c02821fd5\", \"specification_id\": \"742ff9f1-fb89-4aeb-a599-f0e278c7aeaa\"}"
```
16 changes: 16 additions & 0 deletions docs/resources/api_product_version.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@ description: |-

APIProductVersion Resource

## Example Usage

```terraform
resource "konnect_api_product_version" "my_apiproductversion" {
api_product_id = "d32d905a-ed33-46a3-a093-d8f536af9a8a"
deprecated = false
name = "v1"
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down Expand Up @@ -69,3 +77,11 @@ Read-Only:

- `id` (String)
- `name` (String)

## Import

Import is supported using the following syntax:

```shell
terraform import konnect_api_product_version.my_konnect_api_product_version "{ \"api_product_id\": \"d32d905a-ed33-46a3-a093-d8f536af9a8a\", \"id\": \"9f5061ce-78f6-4452-9108-ad7c02821fd5\"}"
```
Loading

0 comments on commit 7d0b771

Please sign in to comment.