Skip to content

Commit

Permalink
cdkft: use reusable workflow and translate more
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielMSchmidt committed Jul 13, 2023
1 parent d54824d commit fbbedfb
Show file tree
Hide file tree
Showing 335 changed files with 23,717 additions and 2,338 deletions.
55 changes: 10 additions & 45 deletions .github/workflows/cdktf-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,48 +10,13 @@ permissions:

jobs:
cdktfDocs:
runs-on:
- custom
- linux
- custom-linux-medium
container:
image: docker.mirror.hashicorp.services/hashicorp/jsii-terraform
env:
CHECKPOINT_DISABLE: "1"
timeout-minutes: 120
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- run: git config --global user.email "[email protected]"
- run: git config --global user.name "team-tf-cdk"
- name: Get yarn cache directory path
id: global-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
id: global-cache
with:
path: ${{ steps.global-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-integration-yarn-${{ hashFiles('**/yarn.lock') }}
- name: Setup Node.js
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3.7.0
with:
node-version: "18.x"
- name: Install cdktf-registry-docs
run: npm install -g [email protected]
- name: Run conversion
run: |
cdktf-registry-docs convert \
--files='*/ec2_*.html.markdown' \
--languages='typescript,python' \
--parallel-file-conversions=1 \
--provider-from-registry="hashicorp/aws" \
.
env:
TF_PLUGIN_CACHE_DIR: ${{ steps.global-cache-dir-path.outputs.dir }}/terraform-plugins

- name: Create Pull Request
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # v5.0.2
with:
commit-message: "docs: update cdktf documentation"
title: "docs: update cdktf documentation"
body: "This PR updates the cdktf related documentation based on the current HCL-based documentation. It is automatically created by the cdktf-documentation GitHub action."
token: ${{ secrets.ORGSCOPED_GITHUB_TOKEN }}
uses: hashicorp/terraform-cdk/.github/workflows/registry-docs-pr-based.yml@304e2507209c9657135dc7b4b7ee68030327468f
secrets:
GH_PR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
providerFqn: "hashicorp/aws"
files: "*/ec2*.html.markdown,*/lambda*.html.markdown,*/eks*.html.markdown,*/vpc*.html.markdown"
languages: "typescript,python"
parallelFileConversions: 1
maxRunners: 20
cdktfRegistryDocsVersion: "1.14.2"
34 changes: 21 additions & 13 deletions website/docs/cdktf/python/d/ec2_client_vpn_endpoint.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ description: |-
Get information on an EC2 Client VPN endpoint
---


<!-- Please do not edit this file, it is generated. -->
# Data Source: aws_ec2_client_vpn_endpoint

Get information on an EC2 Client VPN endpoint.
Expand All @@ -15,15 +17,18 @@ Get information on an EC2 Client VPN endpoint.
### By Filter

```python
import constructs as constructs
import cdktf as cdktf
# Provider bindings are generated by running cdktf get.
# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug
from constructs import Construct
from cdktf import TerraformStack
#
# Provider bindings are generated by running `cdktf get`.
# See https://cdk.tf/provider-generation for more details.
import ...gen.providers.aws as aws
class MyConvertedCode(cdktf.TerraformStack):
#
from imports.aws.data_aws_ec2_client_vpn_endpoint import DataAwsEc2ClientVpnEndpoint
class MyConvertedCode(TerraformStack):
def __init__(self, scope, name):
super().__init__(scope, name)
aws.data_aws_ec2_client_vpn_endpoint.DataAwsEc2ClientVpnEndpoint(self, "example",
DataAwsEc2ClientVpnEndpoint(self, "example",
filter=[DataAwsEc2ClientVpnEndpointFilter(
name="tag:Name",
values=["ExampleVpn"]
Expand All @@ -35,15 +40,18 @@ class MyConvertedCode(cdktf.TerraformStack):
### By Identifier

```python
import constructs as constructs
import cdktf as cdktf
# Provider bindings are generated by running cdktf get.
# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug
from constructs import Construct
from cdktf import TerraformStack
#
# Provider bindings are generated by running `cdktf get`.
# See https://cdk.tf/provider-generation for more details.
import ...gen.providers.aws as aws
class MyConvertedCode(cdktf.TerraformStack):
#
from imports.aws.data_aws_ec2_client_vpn_endpoint import DataAwsEc2ClientVpnEndpoint
class MyConvertedCode(TerraformStack):
def __init__(self, scope, name):
super().__init__(scope, name)
aws.data_aws_ec2_client_vpn_endpoint.DataAwsEc2ClientVpnEndpoint(self, "example",
DataAwsEc2ClientVpnEndpoint(self, "example",
client_vpn_endpoint_id="cvpn-endpoint-083cf50d6eb314f21"
)
```
Expand Down Expand Up @@ -93,4 +101,4 @@ In addition to all arguments above, the following attributes are exported:

- `read` - (Default `20m`)

<!-- cache-key: cdktf-0.17.0-pre.15 input-86166d26a95ae3c88a4d4e7f8804306d48860395f262b9f351921ba97ba82ccc -->
<!-- cache-key: cdktf-0.17.1 input-86166d26a95ae3c88a4d4e7f8804306d48860395f262b9f351921ba97ba82ccc -->
28 changes: 21 additions & 7 deletions website/docs/cdktf/python/d/ec2_coip_pool.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ description: |-
Provides details about a specific EC2 Customer-Owned IP Pool
---


<!-- Please do not edit this file, it is generated. -->
# Data Source: aws_ec2_coip_pool

Provides details about a specific EC2 Customer-Owned IP Pool.
Expand All @@ -18,12 +20,24 @@ COIP Pool.

The following example returns a specific coip pool ID

```terraform
variable "coip_pool_id" {}
data "aws_ec2_coip_pool" "selected" {
id = var.coip_pool_id
}
```python
# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug
from constructs import Construct
from cdktf import TerraformVariable, TerraformStack
#
# Provider bindings are generated by running `cdktf get`.
# See https://cdk.tf/provider-generation for more details.
#
from imports.aws.data_aws_ec2_coip_pool import DataAwsEc2CoipPool
class MyConvertedCode(TerraformStack):
def __init__(self, scope, name):
super().__init__(scope, name)
# Terraform Variables are not always the best fit for getting inputs in the context of Terraform CDK.
# You can read more about this at https://cdk.tf/variables
coip_pool_id = TerraformVariable(self, "coip_pool_id")
DataAwsEc2CoipPool(self, "selected",
id=coip_pool_id.string_value
)
```

## Argument Reference
Expand Down Expand Up @@ -66,4 +80,4 @@ In addition, the following attributes are exported:

- `read` - (Default `20m`)

<!-- cache-key: cdktf-0.17.0-pre.15 input-4018a02fb3e3ba399170a12145e567c04dd4dcf3d3de820650bd0da4b7852ab7 -->
<!-- cache-key: cdktf-0.17.1 input-4018a02fb3e3ba399170a12145e567c04dd4dcf3d3de820650bd0da4b7852ab7 -->
28 changes: 21 additions & 7 deletions website/docs/cdktf/python/d/ec2_coip_pools.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ description: |-
Provides information for multiple EC2 Customer-Owned IP Pools
---


<!-- Please do not edit this file, it is generated. -->
# Data Source: aws_ec2_coip_pools

Provides information for multiple EC2 Customer-Owned IP Pools, such as their identifiers.
Expand All @@ -14,12 +16,24 @@ Provides information for multiple EC2 Customer-Owned IP Pools, such as their ide

The following shows outputting all COIP Pool Ids.

```terraform
data "aws_ec2_coip_pools" "foo" {}
output "foo" {
value = data.aws_ec2_coip_pools.foo.ids
}
```python
# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug
from constructs import Construct
from cdktf import TerraformOutput, TerraformStack
#
# Provider bindings are generated by running `cdktf get`.
# See https://cdk.tf/provider-generation for more details.
#
from imports.aws.data_aws_ec2_coip_pools import DataAwsEc2CoipPools
class MyConvertedCode(TerraformStack):
def __init__(self, scope, name):
super().__init__(scope, name)
foo = DataAwsEc2CoipPools(self, "foo")
cdktf_terraform_output_foo = TerraformOutput(self, "foo_1",
value=foo.ids
)
# This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.
cdktf_terraform_output_foo.override_logical_id("foo")
```

## Argument Reference
Expand Down Expand Up @@ -49,4 +63,4 @@ which take the following arguments:

- `read` - (Default `20m`)

<!-- cache-key: cdktf-0.17.0-pre.15 input-c1c9a426e16105b7a02e1c1b1adc831132ac241239b921ea8b6a60157547ed64 -->
<!-- cache-key: cdktf-0.17.1 input-c1c9a426e16105b7a02e1c1b1adc831132ac241239b921ea8b6a60157547ed64 -->
39 changes: 24 additions & 15 deletions website/docs/cdktf/python/d/ec2_host.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,33 @@ description: |-
Get information on an EC2 Host.
---


<!-- Please do not edit this file, it is generated. -->
# Data Source: aws_ec2_host

Use this data source to get information about an EC2 Dedicated Host.

## Example Usage

```python
import constructs as constructs
import cdktf as cdktf
# Provider bindings are generated by running cdktf get.
# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug
from constructs import Construct
from cdktf import TerraformStack
#
# Provider bindings are generated by running `cdktf get`.
# See https://cdk.tf/provider-generation for more details.
import ...gen.providers.aws as aws
class MyConvertedCode(cdktf.TerraformStack):
#
from imports.aws.data_aws_ec2_host import DataAwsEc2Host
from imports.aws.ec2_host import Ec2Host
class MyConvertedCode(TerraformStack):
def __init__(self, scope, name):
super().__init__(scope, name)
aws_ec2_host_test = aws.ec2_host.Ec2Host(self, "test",
test = Ec2Host(self, "test",
availability_zone="us-west-2a",
instance_type="c5.18xlarge"
)
data_aws_ec2_host_test = aws.data_aws_ec2_host.DataAwsEc2Host(self, "test_1",
host_id=cdktf.Token.as_string(aws_ec2_host_test.id)
data_aws_ec2_host_test = DataAwsEc2Host(self, "test_1",
host_id=test.id
)
# This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.
data_aws_ec2_host_test.override_logical_id("test")
Expand All @@ -35,15 +41,18 @@ class MyConvertedCode(cdktf.TerraformStack):
### Filter Example

```python
import constructs as constructs
import cdktf as cdktf
# Provider bindings are generated by running cdktf get.
# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug
from constructs import Construct
from cdktf import TerraformStack
#
# Provider bindings are generated by running `cdktf get`.
# See https://cdk.tf/provider-generation for more details.
import ...gen.providers.aws as aws
class MyConvertedCode(cdktf.TerraformStack):
#
from imports.aws.data_aws_ec2_host import DataAwsEc2Host
class MyConvertedCode(TerraformStack):
def __init__(self, scope, name):
super().__init__(scope, name)
aws.data_aws_ec2_host.DataAwsEc2Host(self, "test",
DataAwsEc2Host(self, "test",
filter=[DataAwsEc2HostFilter(
name="instance-type",
values=["c5.18xlarge"]
Expand Down Expand Up @@ -92,4 +101,4 @@ In addition to the attributes above, the following attributes are exported:

- `read` - (Default `20m`)

<!-- cache-key: cdktf-0.17.0-pre.15 input-9b4c91c8afc4637faf1832c061bf67a14ccd6dddf8ee04ebb2ecd4958b912e50 -->
<!-- cache-key: cdktf-0.17.1 input-9b4c91c8afc4637faf1832c061bf67a14ccd6dddf8ee04ebb2ecd4958b912e50 -->
19 changes: 12 additions & 7 deletions website/docs/cdktf/python/d/ec2_instance_type.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,27 @@ description: |-
---



<!-- Please do not edit this file, it is generated. -->
# Data Source: aws_ec2_instance_type

Get characteristics for a single EC2 Instance Type.

## Example Usage

```python
import constructs as constructs
import cdktf as cdktf
# Provider bindings are generated by running cdktf get.
# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug
from constructs import Construct
from cdktf import TerraformStack
#
# Provider bindings are generated by running `cdktf get`.
# See https://cdk.tf/provider-generation for more details.
import ...gen.providers.aws as aws
class MyConvertedCode(cdktf.TerraformStack):
#
from imports.aws.data_aws_ec2_instance_type import DataAwsEc2InstanceType
class MyConvertedCode(TerraformStack):
def __init__(self, scope, name):
super().__init__(scope, name)
aws.data_aws_ec2_instance_type.DataAwsEc2InstanceType(self, "example",
DataAwsEc2InstanceType(self, "example",
instance_type="t2.micro"
)
```
Expand Down Expand Up @@ -105,4 +110,4 @@ In addition to the argument above, the following attributes are exported:

- `read` - (Default `20m`)

<!-- cache-key: cdktf-0.17.0-pre.15 input-2b636f57a79c9545305113d01a6f8b0a344a9f774db0d6a467fd46c35a6802c0 -->
<!-- cache-key: cdktf-0.17.1 input-2b636f57a79c9545305113d01a6f8b0a344a9f774db0d6a467fd46c35a6802c0 -->
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,27 @@ description: |-
Information about single EC2 Instance Type Offering.
---


<!-- Please do not edit this file, it is generated. -->
# Data Source: aws_ec2_instance_type_offering

Information about single EC2 Instance Type Offering.

## Example Usage

```python
import constructs as constructs
import cdktf as cdktf
# Provider bindings are generated by running cdktf get.
# Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug
from constructs import Construct
from cdktf import TerraformStack
#
# Provider bindings are generated by running `cdktf get`.
# See https://cdk.tf/provider-generation for more details.
import ...gen.providers.aws as aws
class MyConvertedCode(cdktf.TerraformStack):
#
from imports.aws.data_aws_ec2_instance_type_offering import DataAwsEc2InstanceTypeOffering
class MyConvertedCode(TerraformStack):
def __init__(self, scope, name):
super().__init__(scope, name)
aws.data_aws_ec2_instance_type_offering.DataAwsEc2InstanceTypeOffering(self, "example",
DataAwsEc2InstanceTypeOffering(self, "example",
filter=[DataAwsEc2InstanceTypeOfferingFilter(
name="instance-type",
values=["t2.micro", "t3.micro"]
Expand Down Expand Up @@ -57,4 +62,4 @@ In addition to all arguments above, the following attributes are exported:

- `read` - (Default `20m`)

<!-- cache-key: cdktf-0.17.0-pre.15 input-b9a0baa6d38287dcfdc6f70833e23287a617a652af798b75206cc22860a785e7 -->
<!-- cache-key: cdktf-0.17.1 input-b9a0baa6d38287dcfdc6f70833e23287a617a652af798b75206cc22860a785e7 -->
Loading

0 comments on commit fbbedfb

Please sign in to comment.