Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initial implementation #6

Merged
merged 32 commits into from
Jan 28, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
7641b51
initial implementation
mcalhoun Jan 26, 2021
31ebf0a
update test versions
mcalhoun Jan 26, 2021
12bb6b3
update docs with testing locally
mcalhoun Jan 26, 2021
e344f05
remove extra line
mcalhoun Jan 26, 2021
953df28
add additional developer docs
mcalhoun Jan 26, 2021
0591e42
additional doc
mcalhoun Jan 26, 2021
d448a38
fix test
mcalhoun Jan 26, 2021
9b093f9
update env var name
mcalhoun Jan 26, 2021
01f1df0
update release regex
mcalhoun Jan 27, 2021
797110a
Set tab stops for GitHub
Nuru Jan 27, 2021
61a902a
refactor for deep merge
mcalhoun Jan 27, 2021
fa07f43
update comment
mcalhoun Jan 27, 2021
9c76b23
update test triggers
mcalhoun Jan 27, 2021
e839487
cleanup tests
mcalhoun Jan 28, 2021
731db1f
update workflows
mcalhoun Jan 28, 2021
8684e51
update .go-version
mcalhoun Jan 28, 2021
06692cf
update gitignore
mcalhoun Jan 28, 2021
3342bbd
update makefile targeet
mcalhoun Jan 28, 2021
79f31cf
update docs generation
mcalhoun Jan 28, 2021
f151a65
README updates
mcalhoun Jan 28, 2021
a1dbe58
update readme
mcalhoun Jan 28, 2021
e8fb23b
update readme
mcalhoun Jan 28, 2021
84d32b2
update readme
mcalhoun Jan 28, 2021
5288047
update docs
mcalhoun Jan 28, 2021
5f576d2
update readme
mcalhoun Jan 28, 2021
c0a63cb
update docs
mcalhoun Jan 28, 2021
afda033
update license
mcalhoun Jan 28, 2021
424075a
Update LICENSE
aknysh Jan 28, 2021
6f34114
update readme
mcalhoun Jan 28, 2021
02dbf27
update readme
mcalhoun Jan 28, 2021
68070a1
Handle Go errors
aknysh Jan 28, 2021
6f82648
Merge remote-tracking branch 'origin/feature/initial-implementation' …
aknysh Jan 28, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update docs
  • Loading branch information
mcalhoun committed Jan 28, 2021
commit 52880476c1fb6c1502e2245276e04be6632fe3a0
120 changes: 120 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,126 @@ Here are some examples of using this provider:



## Developing the Provider

If you wish to work on the provider, you'll first need [Go](http://www.golang.org) installed on your machine (see [Requirements](#requirements) above).

To compile the provider, run `go install`. This will build the provider and put the provider binary in the `$GOPATH/bin` directory.

To generate or update documentation, run `go generate`.

In order to run the full suite of Acceptance tests, run `make testacc`.

_Note:_ Acceptance tests create real resources, and often cost money to run.

```sh
$ make testacc
```

### Testing Locally

You can test the provider locally by using the [provider_installation](https://www.terraform.io/docs/cli/config/config-file.html#provider-installation) functionality.

For testing this provider, you can edit your `~/.terraformrc` file with the following:

```hcl
provider_installation {
dev_overrides {
"cloudposse/utils" = "/path/to/your/code/github.com/cloudposse/terraform-provider-utils/"
}

# For all other providers, install them directly from their origin provider
# registries as normal. If you omit this, Terraform will _only_ use
# the dev_overrides block, and so no other providers will be available.
direct {}
}
```

With that in place, you can build the provider (see above) and add a provider block:

```hcl
required_providers {
utils = {
source = "cloudposse/utils"
}
}
```

Then run `terraform init`, `terraform plan` and `terraform apply` as normal.

```sh
$ terraform init
Initializing the backend...

Initializing provider plugins...
- Finding latest version of cloudposse/utils...

Warning: Provider development overrides are in effect

The following provider development overrides are set in the CLI configuration:
- cloudposse/utils in /path/to/your/code/github.com/cloudposse/terraform-provider-utils

The behavior may therefore not match any released version of the provider and
applying changes may cause the state to become incompatible with published
releases.


Error: Failed to query available provider packages

Could not retrieve the list of available versions for provider
cloudposse/utils: provider registry registry.terraform.io does not have a
provider named registry.terraform.io/cloudposse/utils
```

```sh
terraform apply

Warning: Provider development overrides are in effect

The following provider development overrides are set in the CLI configuration:
- cloudposse/utils in /Users/matt/code/src/github.com/cloudposse/terraform-provider-utils

The behavior may therefore not match any released version of the provider and
applying changes may cause the state to become incompatible with published
releases.


An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:

Terraform will perform the following actions:

Plan: 0 to add, 0 to change, 0 to destroy.

Changes to Outputs:
+ deep_merge_output = <<-EOT
Statement:
- Action:
- s3:*
Effect: Allow
Resource:
- '*'
Sid: FullAccess
- Action:
- s3:*
Complex:
ExtraComplex:
ExtraExtraComplex:
Foo: bazzz
SomeArray:
- one
- two
- three
Effect: Deny
Resource:
- arn:aws:s3:::customer
- arn:aws:s3:::customer/*
- foo
Sid: DenyCustomerBucket
Version: "2012-10-17"
EOT
```



## Share the Love
Expand Down
5 changes: 2 additions & 3 deletions README.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,8 @@ examples: |-
- [`examples/data-sources/deep_merge_json`](/examples/data-sources/deep_merge_json/)
- [`examples/data-sources/deep_merge_yaml`](/examples/data-sources/deep_merge_yaml/)

#include:
# - "docs/index.md"
# - "docs/data-sources/deep_merge.md"
include:
- "docs/developer.md"

# Contributors to this project
contributors:
Expand Down
119 changes: 119 additions & 0 deletions docs/developer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
## Developing the Provider

If you wish to work on the provider, you'll first need [Go](http://www.golang.org) installed on your machine (see [Requirements](#requirements) above).

To compile the provider, run `go install`. This will build the provider and put the provider binary in the `$GOPATH/bin` directory.

To generate or update documentation, run `go generate`.

In order to run the full suite of Acceptance tests, run `make testacc`.

_Note:_ Acceptance tests create real resources, and often cost money to run.

```sh
$ make testacc
```

### Testing Locally

You can test the provider locally by using the [provider_installation](https://www.terraform.io/docs/cli/config/config-file.html#provider-installation) functionality.

For testing this provider, you can edit your `~/.terraformrc` file with the following:

```hcl
provider_installation {
dev_overrides {
"cloudposse/utils" = "/path/to/your/code/github.com/cloudposse/terraform-provider-utils/"
}

# For all other providers, install them directly from their origin provider
# registries as normal. If you omit this, Terraform will _only_ use
# the dev_overrides block, and so no other providers will be available.
direct {}
}
```

With that in place, you can build the provider (see above) and add a provider block:

```hcl
required_providers {
utils = {
source = "cloudposse/utils"
}
}
```

Then run `terraform init`, `terraform plan` and `terraform apply` as normal.

```sh
$ terraform init
Initializing the backend...

Initializing provider plugins...
- Finding latest version of cloudposse/utils...

Warning: Provider development overrides are in effect

The following provider development overrides are set in the CLI configuration:
- cloudposse/utils in /path/to/your/code/github.com/cloudposse/terraform-provider-utils

The behavior may therefore not match any released version of the provider and
applying changes may cause the state to become incompatible with published
releases.


Error: Failed to query available provider packages

Could not retrieve the list of available versions for provider
cloudposse/utils: provider registry registry.terraform.io does not have a
provider named registry.terraform.io/cloudposse/utils
```

```sh
terraform apply

Warning: Provider development overrides are in effect

The following provider development overrides are set in the CLI configuration:
- cloudposse/utils in /Users/matt/code/src/github.com/cloudposse/terraform-provider-utils

The behavior may therefore not match any released version of the provider and
applying changes may cause the state to become incompatible with published
releases.


An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:

Terraform will perform the following actions:

Plan: 0 to add, 0 to change, 0 to destroy.

Changes to Outputs:
+ deep_merge_output = <<-EOT
Statement:
- Action:
- s3:*
Effect: Allow
Resource:
- '*'
Sid: FullAccess
- Action:
- s3:*
Complex:
ExtraComplex:
ExtraExtraComplex:
Foo: bazzz
SomeArray:
- one
- two
- three
Effect: Deny
Resource:
- arn:aws:s3:::customer
- arn:aws:s3:::customer/*
- foo
Sid: DenyCustomerBucket
Version: "2012-10-17"
EOT
```
11 changes: 11 additions & 0 deletions docs/targets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- markdownlint-disable -->
## Makefile Targets
```text
Available targets:

help Help screen
help/all Display help for all targets
help/short This help short screen

```
<!-- markdownlint-restore -->
18 changes: 18 additions & 0 deletions docs/terraform.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!-- markdownlint-disable -->
## Requirements

No requirements.

## Providers

No provider.

## Inputs

No input.

## Outputs

No output.

<!-- markdownlint-restore -->