Skip to content

Commit

Permalink
chore: add replace directive to go.mod, and update README.md file
Browse files Browse the repository at this point in the history
  • Loading branch information
a-h authored and DanielMSchmidt committed Aug 23, 2022
1 parent 93c3dfd commit 6744c3a
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 8 deletions.
1 change: 1 addition & 0 deletions examples/go/google-cloudrun/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cdktf-example.json
37 changes: 37 additions & 0 deletions examples/go/google-cloudrun/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,40 @@
# google-cloudrun

A port of the TypeScript example at: https://github.com/hashicorp/terraform-cdk/tree/main/examples/typescript/google-cloudrun

This resembles the example for the Google Cloud at [Hashicorp Learn](https://learn.hashicorp.com/terraform/gcp/build)

## Usage

Install project dependencies

```shell
go get ./...
```

Generate CDK for Terraform constructs for Terraform provides and modules used in the project.

```bash
cdktf get
```

You can now edit the `main.go` file if you want to modify any code.

Make sure to create your credential file `cdktf-example.json` to make this example usable.

Generate Terraform configuration

```bash
cdktf synth
```

The above command will create a folder called `cdktf.out` that contains all Terraform JSON configuration that was generated.

See changes `cdktf diff` and deploy via `cdktf deploy`.

When you're done run `cdktf destroy`.

You need

- `GCP project ID`
- `cdktf-example.json` file containing your GCP `credentials`
6 changes: 4 additions & 2 deletions examples/go/google-cloudrun/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ module github.com/hashicorp/terraform-cdk/examples/go/google-cloudrun

go 1.16

require github.com/aws/constructs-go/constructs/v10 v10.1.59
require github.com/aws/constructs-go/constructs/v10 v10.1.70

require (
github.com/aws/jsii-runtime-go v1.63.1
github.com/aws/jsii-runtime-go v1.63.2
github.com/hashicorp/cdktf-provider-google-go/google v0.0.0
github.com/hashicorp/terraform-cdk-go/cdktf v0.12.0
)

replace github.com/hashicorp/terraform-cdk-go/cdktf => ../../../packages/cdktf/dist/go/cdktf
10 changes: 4 additions & 6 deletions examples/go/google-cloudrun/go.sum
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc=
github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs=
github.com/aws/constructs-go/constructs/v10 v10.1.56/go.mod h1:QHRf47JAv2Q7+qc0NzQVWQAo4LcdzF1PMN04ZvgFtiw=
github.com/aws/constructs-go/constructs/v10 v10.1.59 h1:c56BhjYCzISjN7P/qcAo1owihZzZZTf0t/w1qLx7r7w=
github.com/aws/constructs-go/constructs/v10 v10.1.59/go.mod h1:AwUw5UrI0xFuT53aqvPIA3v/U+XZlQXXMDPIVEaDbig=
github.com/aws/jsii-runtime-go v1.62.0/go.mod h1:Dq2QkYFSpiHGabsCBMmLnnGkyx3lnf5k6C6fq8RN/90=
github.com/aws/jsii-runtime-go v1.63.1 h1:D4R2THMIPb/7iLJsl/R9NRxauYmgirmTutfc80OoKig=
github.com/aws/constructs-go/constructs/v10 v10.1.70 h1:YulEO5GyTLe2AjlhEMGKBgf0Lp75a6uk12hNKrreqfM=
github.com/aws/constructs-go/constructs/v10 v10.1.70/go.mod h1:nJzXC/q76n0XkbL76eG0OvJQwbD/lWc7sjerJEARubA=
github.com/aws/jsii-runtime-go v1.63.1/go.mod h1:Dq2QkYFSpiHGabsCBMmLnnGkyx3lnf5k6C6fq8RN/90=
github.com/aws/jsii-runtime-go v1.63.2 h1:brb+tRuZ3lDzFuz6DJCkv7fYLYkTKGVcSb4OgVybsa4=
github.com/aws/jsii-runtime-go v1.63.2/go.mod h1:Dq2QkYFSpiHGabsCBMmLnnGkyx3lnf5k6C6fq8RN/90=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/hashicorp/cdktf-provider-google-go/google v0.0.0 h1:7VabEsXnr751UrKyMQFX0WW8ExjOjcKJTCf48g5k+h0=
github.com/hashicorp/cdktf-provider-google-go/google v0.0.0/go.mod h1:kocOZbudzYH3ScSnfxQzJCLAycyesBo9+XK1qL7aLuc=
github.com/hashicorp/terraform-cdk-go/cdktf v0.12.0 h1:xNbMaZdhB5mKbrc7eSu6cIUcwJkhhDzmJPRhaNgAOCY=
github.com/hashicorp/terraform-cdk-go/cdktf v0.12.0/go.mod h1:jaEAIWsKKD4EDjXCpaZAsFhHmxP4y7giBC5lX6YU69A=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
Expand Down

0 comments on commit 6744c3a

Please sign in to comment.