Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into oauthbearer
Browse files Browse the repository at this point in the history
  • Loading branch information
Mongey committed Mar 13, 2024
2 parents 518faf9 + 1ee2ffa commit 1b00c54
Show file tree
Hide file tree
Showing 8 changed files with 276 additions and 169 deletions.
43 changes: 40 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,56 @@ provider "kafka" {
}
```

Example provider with aws-iam(Assume role) client authentication.
```hcl
provider "kafka" {
bootstrap_servers = ["localhost:9098"]
tls_enabled = true
sasl_mechanism = "aws-iam"
sasl_aws_region = "us-east-1"
sasl_aws_role_arn = "arn:aws:iam::account:role/role-name"
}
```

Example provider with aws-iam(Aws Profile) client authentication.
```hcl
provider "kafka" {
bootstrap_servers = ["localhost:9098"]
tls_enabled = true
sasl_mechanism = "aws-iam"
sasl_aws_region = "us-east-1"
sasl_aws_profile = "dev"
}
```

Example provider with aws-iam(Static Creds) client authentication. You have to export `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_SESSION_TOKEN`(Optional if you are using temp creds)
```hcl
provider "kafka" {
bootstrap_servers = ["localhost:9098"]
tls_enabled = true
sasl_mechanism = "aws-iam"
sasl_aws_region = "us-east-1"
}
```

| Property | Description | Default |
| ------------------- | --------------------------------------------------------------------------------------------------------------------- | ---------- |
| `bootstrap_servers` | A list of host:port addresses that will be used to discover the full set of alive brokers | `Required` |
| `ca_cert` | The CA certificate or path to a CA certificate file in `PEM` format to validate the server's certificate. | `""` |
| `ca_cert` | The CA certificate or path to a CA certificate file in `PEM` format to validate the server's certificate. | `""` |
| `client_cert` | The client certificate or path to a file containing the client certificate in `PEM` format. Use for Client authentication to Kafka.<br>If you have Intermediate CA certificate(s) append them to `client_cert`.| `""` |
| `client_key` | The private key or path to a file containing the private key that the client certificate was issued for. | `""` |
| `client_key_passphrase` | The passphrase for the private key that the certificate was issued for. | `""` |
| `tls_enabled` | Enable communication with the Kafka Cluster over TLS. | `true` |
| `skip_tls_verify` | Skip TLS verification. | `false` |
| `sasl_username` | Username for SASL authentication. | `""` |
| `sasl_password` | Password for SASL authentication. | `""` |
| `sasl_token_url` | The url to retrieve oauth2 tokens from, when using sasl mechanism oauthbearer | `""` |
| `sasl_mechanism` | Mechanism for SASL authentication. Allowed values are plain, scram-sha512, scram-sha256 and oauthbearer | `plain` |
| `sasl_mechanism` | Mechanism for SASL authentication. Allowed values are `plain`, `aws-iam`, `scram-sha256`, `scram-sha512` or `oauthbearer` | `plain` |
| `sasl_aws_region` | AWS region for IAM authentication. | `""` |
| `sasl_aws_role_arn` | Arn of AWS IAM role to assume for IAM authentication. | `""` |
| `sasl_aws_profile` | AWS profile to use for IAM authentication. | `""` |
| `sasl_aws_creds_debug` | Enable debug logging for AWS authentication. | `false` |
| `sasl_token_url` | The url to retrieve oauth2 tokens from, when using sasl mechanism `oauthbearer` | `""` |
## Resources
### `kafka_topic`
Expand Down
6 changes: 5 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,13 @@ description: |-
- `client_key` (String) The private key that the certificate was issued for.
- `client_key_file` (String, Deprecated) Path to a file containing the private key that the certificate was issued for.
- `client_key_passphrase` (String) The passphrase for the private key that the certificate was issued for.
- `sasl_mechanism` (String) SASL mechanism, can be plain, scram-sha512, scram-sha256
- `sasl_mechanism` (String) SASL mechanism, can be plain, scram-sha512, scram-sha256, aws-iam
- `sasl_password` (String) Password for SASL authentication.
- `sasl_username` (String) Username for SASL authentication.
- `sasl_aws_region` (String) AWS region where MSK is deployed. Required when sasl_mechanism is aws-iam.
- `sasl_aws_role_arn` (String) IAM role ARN to Assume.
- `sasl_aws_profile` (String) AWS profile name to use.
- `sasl_aws_creds_debug` (Boolean) Set this to true to turn AWS credentials debug.
- `skip_tls_verify` (Boolean) Set this to true only if the target Kafka server is an insecure development instance.
- `timeout` (Number) Timeout in seconds
- `tls_enabled` (Boolean) Enable communication with the Kafka Cluster over TLS.
56 changes: 20 additions & 36 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,22 @@ go 1.21
toolchain go1.21.6

require (
github.com/IBM/sarama v1.42.1
github.com/IBM/sarama v1.43.0
github.com/aws/aws-msk-iam-sasl-signer-go v1.0.0
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320
github.com/hashicorp/go-uuid v1.0.3
github.com/hashicorp/terraform-plugin-docs v0.16.0
github.com/hashicorp/terraform-plugin-docs v0.18.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.32.0
github.com/xdg/scram v1.0.5
golang.org/x/net v0.20.0
golang.org/x/net v0.22.0
golang.org/x/oauth2 v0.16.0
)

require (
github.com/Kunde21/markdownfmt/v3 v3.1.0 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver/v3 v3.1.1 // indirect
github.com/Masterminds/sprig/v3 v3.2.2 // indirect
github.com/Masterminds/semver/v3 v3.2.0 // indirect
github.com/Masterminds/sprig/v3 v3.2.3 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect
github.com/agext/levenshtein v1.2.2 // indirect
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
Expand All @@ -37,34 +38,25 @@ require (
github.com/aws/aws-sdk-go-v2/service/sts v1.19.3 // indirect
github.com/aws/smithy-go v1.13.5 // indirect
github.com/bgentry/speakeasy v0.1.0 // indirect
github.com/cilium/ebpf v0.12.3 // indirect
github.com/cloudflare/circl v1.3.7 // indirect
github.com/cosiner/argv v0.1.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/derekparker/trie v0.0.0-20230829180723-39f4de51ef7d // indirect
github.com/eapache/go-resiliency v1.4.0 // indirect
github.com/eapache/go-resiliency v1.6.0 // indirect
github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 // indirect
github.com/eapache/queue v1.1.0 // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/go-delve/delve v1.22.0 // indirect
github.com/go-delve/gore v0.11.7 // indirect
github.com/go-delve/liner v1.2.3-0.20220127212407-d32d89dd2a5d // indirect
github.com/go-resty/resty/v2 v2.7.0 // indirect
github.com/golang-jwt/jwt/v5 v5.0.0 // indirect
github.com/fatih/color v1.16.0 // indirect
github.com/frankban/quicktest v1.14.5 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/go-dap v0.11.0 // indirect
github.com/google/uuid v1.4.0 // indirect
github.com/hashicorp/cli v1.1.6 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-checkpoint v0.5.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-hclog v1.5.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-plugin v1.6.0 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/hashicorp/golang-lru v1.0.2 // indirect
github.com/hashicorp/hc-install v0.6.2 // indirect
github.com/hashicorp/hcl/v2 v2.19.1 // indirect
github.com/hashicorp/logutils v1.0.0 // indirect
Expand All @@ -75,57 +67,49 @@ require (
github.com/hashicorp/terraform-registry-address v0.2.3 // indirect
github.com/hashicorp/terraform-svchost v0.1.1 // indirect
github.com/hashicorp/yamux v0.1.1 // indirect
github.com/huandu/xstrings v1.3.2 // indirect
github.com/huandu/xstrings v1.3.3 // indirect
github.com/imdario/mergo v0.3.15 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jcmturner/aescts/v2 v2.0.0 // indirect
github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect
github.com/jcmturner/gofork v1.7.6 // indirect
github.com/jcmturner/gokrb5/v8 v8.4.4 // indirect
github.com/jcmturner/rpc/v2 v2.0.3 // indirect
github.com/klauspost/compress v1.16.7 // indirect
github.com/klauspost/compress v1.17.7 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/mitchellh/cli v1.1.5 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/mitchellh/go-wordwrap v1.0.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/oklog/run v1.0.0 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/pierrec/lz4/v4 v4.1.18 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pierrec/lz4/v4 v4.1.21 // indirect
github.com/posener/complete v1.2.3 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/rivo/uniseg v0.4.6 // indirect
github.com/russross/blackfriday v1.6.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/segmentio/ksuid v1.0.4 // indirect
github.com/shopspring/decimal v1.3.1 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/cobra v1.8.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/xdg/stringprep v1.0.3 // indirect
github.com/yuin/goldmark v1.6.0 // indirect
github.com/yuin/goldmark-meta v1.1.0 // indirect
github.com/zclconf/go-cty v1.14.2 // indirect
go.starlark.net v0.0.0-20240123142251-f86470692795 // indirect
golang.org/x/arch v0.7.0 // indirect
golang.org/x/crypto v0.18.0 // indirect
golang.org/x/exp v0.0.0-20240119083558-1b970713d09a // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.14.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect
google.golang.org/grpc v1.61.0 // indirect
google.golang.org/protobuf v1.32.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

replace git.apache.org/thrift.git => github.com/apache/thrift v0.0.0-20180902110319-2566ecd5d999
Loading

0 comments on commit 1b00c54

Please sign in to comment.