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

fix: Set basic_auth to optional in self_managed_kafka_parameters #34293

Merged
merged 5 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .changelog/34293.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
resource/aws_pipes_pipe: Mark `source_parameters.self_managed_kafka_parameters.credentials.basic_auth` as Optional
```
4 changes: 2 additions & 2 deletions internal/service/pipes/exports_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package pipes

// Exports for use in tests only.
var (
FindPipeByName = findPipeByName

ResourcePipe = resourcePipe

FindPipeByName = findPipeByName
)
138 changes: 70 additions & 68 deletions internal/service/pipes/pipe.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,74 +50,76 @@ func resourcePipe() *schema.Resource {

CustomizeDiff: verify.SetTagsDiff,

Schema: map[string]*schema.Schema{
names.AttrARN: {
Type: schema.TypeString,
Computed: true,
},
names.AttrDescription: {
Type: schema.TypeString,
Optional: true,
Default: "Managed by Terraform",
},
"desired_state": {
Type: schema.TypeString,
Optional: true,
Default: string(awstypes.RequestedPipeStateRunning),
ValidateDiagFunc: enum.Validate[awstypes.RequestedPipeState](),
},
"enrichment": {
Type: schema.TypeString,
Optional: true,
ValidateFunc: verify.ValidARN,
},
"enrichment_parameters": enrichmentParametersSchema(),
"log_configuration": logConfigurationSchema(),
names.AttrName: {
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
ConflictsWith: []string{names.AttrNamePrefix},
ValidateFunc: validation.All(
validation.StringLenBetween(1, 64),
validation.StringMatch(regexache.MustCompile(`^[0-9A-Za-z_.-]+`), ""),
),
},
names.AttrNamePrefix: {
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
ConflictsWith: []string{names.AttrName},
ValidateFunc: validation.All(
validation.StringLenBetween(1, 64-id.UniqueIDSuffixLength),
validation.StringMatch(regexache.MustCompile(`^[0-9A-Za-z_.-]+`), ""),
),
},
names.AttrRoleARN: {
Type: schema.TypeString,
Required: true,
ValidateFunc: verify.ValidARN,
},
names.AttrSource: {
Type: schema.TypeString,
Required: true,
ForceNew: true,
ValidateFunc: validation.Any(
verify.ValidARN,
validation.StringMatch(regexache.MustCompile(`^smk://(([0-9A-Za-z]|[0-9A-Za-z][0-9A-Za-z-]*[0-9A-Za-z])\.)*([0-9A-Za-z]|[0-9A-Za-z][0-9A-Za-z-]*[0-9A-Za-z]):[0-9]{1,5}|arn:(aws[0-9A-Za-z-]*):([0-9A-Za-z-]+):([a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1})?:(\d{12})?:(.+)$`), ""),
),
},
"source_parameters": sourceParametersSchema(),
names.AttrTarget: {
Type: schema.TypeString,
Required: true,
ValidateFunc: verify.ValidARN,
},
"target_parameters": targetParametersSchema(),
names.AttrTags: tftags.TagsSchema(),
names.AttrTagsAll: tftags.TagsSchemaComputed(),
SchemaFunc: func() map[string]*schema.Schema {
return map[string]*schema.Schema{
names.AttrARN: {
Type: schema.TypeString,
Computed: true,
},
names.AttrDescription: {
Type: schema.TypeString,
Optional: true,
Default: "Managed by Terraform",
},
"desired_state": {
Type: schema.TypeString,
Optional: true,
Default: string(awstypes.RequestedPipeStateRunning),
ValidateDiagFunc: enum.Validate[awstypes.RequestedPipeState](),
},
"enrichment": {
Type: schema.TypeString,
Optional: true,
ValidateFunc: verify.ValidARN,
},
"enrichment_parameters": enrichmentParametersSchema(),
"log_configuration": logConfigurationSchema(),
names.AttrName: {
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
ConflictsWith: []string{names.AttrNamePrefix},
ValidateFunc: validation.All(
validation.StringLenBetween(1, 64),
validation.StringMatch(regexache.MustCompile(`^[0-9A-Za-z_.-]+`), ""),
),
},
names.AttrNamePrefix: {
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
ConflictsWith: []string{names.AttrName},
ValidateFunc: validation.All(
validation.StringLenBetween(1, 64-id.UniqueIDSuffixLength),
validation.StringMatch(regexache.MustCompile(`^[0-9A-Za-z_.-]+`), ""),
),
},
names.AttrRoleARN: {
Type: schema.TypeString,
Required: true,
ValidateFunc: verify.ValidARN,
},
names.AttrSource: {
Type: schema.TypeString,
Required: true,
ForceNew: true,
ValidateFunc: validation.Any(
verify.ValidARN,
validation.StringMatch(regexache.MustCompile(`^smk://(([0-9A-Za-z]|[0-9A-Za-z][0-9A-Za-z-]*[0-9A-Za-z])\.)*([0-9A-Za-z]|[0-9A-Za-z][0-9A-Za-z-]*[0-9A-Za-z]):[0-9]{1,5}|arn:(aws[0-9A-Za-z-]*):([0-9A-Za-z-]+):([a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1})?:(\d{12})?:(.+)$`), ""),
),
},
"source_parameters": sourceParametersSchema(),
names.AttrTarget: {
Type: schema.TypeString,
Required: true,
ValidateFunc: verify.ValidARN,
},
"target_parameters": targetParametersSchema(),
names.AttrTags: tftags.TagsSchema(),
names.AttrTagsAll: tftags.TagsSchemaComputed(),
}
},
}
}
Expand Down
2 changes: 1 addition & 1 deletion internal/service/pipes/source_parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ func sourceParametersSchema() *schema.Schema {
Schema: map[string]*schema.Schema{
"basic_auth": {
Type: schema.TypeString,
Required: true,
Optional: true,
vzilinas marked this conversation as resolved.
Show resolved Hide resolved
ValidateFunc: verifySecretsManagerARN,
},
"client_certificate_tls_auth": {
Expand Down
Loading