Skip to content

Commit c38526d

Browse files
authored
Merge pull request #44162 from KyMidd/main
Add AppConfig multi-variate example
2 parents 0422d06 + f1e6e53 commit c38526d

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

website/docs/r/appconfig_hosted_configuration_version.html.markdown

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,42 @@ resource "aws_appconfig_hosted_configuration_version" "example" {
7979
}
8080
```
8181

82+
### Multi-variant Feature Flags
83+
84+
```terraform
85+
resource "aws_appconfig_hosted_configuration_version" "example" {
86+
application_id = aws_appconfig_application.example.id
87+
configuration_profile_id = aws_appconfig_configuration_profile.example.configuration_profile_id
88+
description = "Example Multi-variant Feature Flag Configuration Version"
89+
content_type = "application/json"
90+
91+
content = jsonencode({
92+
flags = {
93+
loggingenabled = {
94+
name = "loggingEnabled"
95+
}
96+
},
97+
values = {
98+
loggingenabled = {
99+
_variants = concat([
100+
for user_id in var.appcfg_enableLogging_userIds : { # Flat list of userIds
101+
enabled = true,
102+
name = "usersWithLoggingEnabled_${user_id}",
103+
rule = "(or (eq $userId \"${user_id}\"))"
104+
}
105+
], [
106+
{
107+
enabled = false,
108+
name = "Default"
109+
}
110+
])
111+
}
112+
},
113+
version = "1"
114+
})
115+
}
116+
```
117+
82118
## Argument Reference
83119

84120
This resource supports the following arguments:

0 commit comments

Comments
 (0)