-
Notifications
You must be signed in to change notification settings - Fork 207
feat: Support OIDC configs in mongodbatlas_stream_connection #3680
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
base: master
Are you sure you want to change the base?
Changes from all commits
8d9c0aa
f0e6f3c
7b67ebc
b37d57e
5d586ec
6f75bbe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,3 @@ | ||||||
```release-note:enhancement | ||||||
resource/mongodbatlas_stream_connection: Add new authentication mechanism(OIDC) to the Kafka connection | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
3rd person for changelog messages |
||||||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,9 +43,15 @@ If `type` is of value `Https` the following additional attributes are defined: | |
|
||
### Authentication | ||
|
||
* `mechanism` - Style of authentication. Can be one of `PLAIN`, `SCRAM-256`, or `SCRAM-512`. | ||
* `mechanism` - Style of authentication. Can be one of `PLAIN`, `SCRAM-256`, `SCRAM-512`, or `OAUTHBEARER`. | ||
* `username` - Username of the account to connect to the Kafka cluster. | ||
* `password` - Password of the account to connect to the Kafka cluster. | ||
* `token_endpoint_url` - OAUTH issuer(IdP provider) token endpoint HTTP(S) URI used to retrieve the token. | ||
* `client_id` - Public identifier for the Kafka client. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do all new attributes apply to Kafka? in that case consider having them inside a |
||
* `client_secret` - Secret known only to the Kafka client and the authorization server. | ||
* `scope` - Kafka clients use this to specify the scope of the access request to the broker. | ||
* `sasl_oauthbearer_extensions` - Additional information to be provided to the Kafka broker. | ||
* `https_ca_pem` - The CA certificates as a PEM string. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do you think it would be helpful to note these should be concatenated? Any specific certs in the chain that are not required? is a specific order required? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do you mean by "be concatenated"? No specific order is required. We don't want to mark |
||
|
||
### Security | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,6 +55,38 @@ resource "mongodbatlas_stream_connection" "test" { | |
} | ||
``` | ||
|
||
### Example Kafka SASL OAuthbearer Connection | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. new attributes description is missing in resource doc page |
||
|
||
```terraform | ||
resource "mongodbatlas_stream_connection" "example-kafka-oauthbearer" { | ||
project_id = var.project_id | ||
instance_name = mongodbatlas_stream_instance.example.instance_name | ||
connection_name = "KafkaOAuthbearerConnection" | ||
type = "Kafka" | ||
authentication = { | ||
mechanism = "OAUTHBEARER" | ||
token_endpoint_url = "https://example.com/oauth/token" | ||
client_id = "auth0Client" | ||
client_secret = var.kafka_client_secret | ||
scope = "read:messages write:messages" | ||
sasl_oauthbearer_extensions = "logicalCluster=lkc-kmom,identityPoolId=pool-lAr" | ||
https_ca_pem = "pemtext" | ||
} | ||
bootstrap_servers = "localhost:9092,localhost:9092" | ||
config = { | ||
"auto.offset.reset" : "earliest" | ||
} | ||
security = { | ||
protocol = "SASL_PLAINTEXT" | ||
} | ||
networking = { | ||
access = { | ||
type = "PUBLIC" | ||
} | ||
} | ||
} | ||
``` | ||
|
||
### Example Kafka SASL SSL Connection | ||
|
||
```terraform | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,6 +82,25 @@ func ResourceSchema(ctx context.Context) schema.Schema { | |
"username": schema.StringAttribute{ | ||
Optional: true, | ||
}, | ||
"token_endpoint_url": schema.StringAttribute{ | ||
Optional: true, | ||
}, | ||
"client_id": schema.StringAttribute{ | ||
Optional: true, | ||
}, | ||
"client_secret": schema.StringAttribute{ | ||
Optional: true, | ||
Sensitive: true, | ||
}, | ||
"scope": schema.StringAttribute{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. q: does Atlas return some default value if not provided by the client? in that case the atribute might need to be Optional & Computed, although better to keep it as Optional if possible |
||
Optional: true, | ||
}, | ||
"sasl_oauthbearer_extensions": schema.StringAttribute{ | ||
Optional: true, | ||
}, | ||
"https_ca_pem": schema.StringAttribute{ | ||
Optional: true, | ||
}, | ||
}, | ||
}, | ||
"bootstrap_servers": schema.StringAttribute{ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changelog entries for the 2 datasources are missing