Skip to content

Commit 05569f0

Browse files
committed
Add aws_opensearchserverless_collection_group resource
Signed-off-by: Federico <github-fed-sv.unrigged670@passmail.com>
1 parent 550c6ce commit 05569f0

3 files changed

Lines changed: 63 additions & 0 deletions

File tree

config/externalname.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ var TerraformPluginFrameworkExternalNameConfigs = map[string]config.ExternalName
151151
"aws_opensearchserverless_access_policy": config.NameAsIdentifier,
152152
// Collection can be imported using the AWS-assigned collection ID. i.e. ch9rq91uv4yd8rff1f39
153153
"aws_opensearchserverless_collection": opensearchserverlessCollection(),
154+
// CollectionGroup can be imported using the AWS-assigned collection group ID
155+
"aws_opensearchserverless_collection_group": opensearchserverlessCollectionGroup(),
154156
// LifecyclePolicy can be imported using the policy name
155157
"aws_opensearchserverless_lifecycle_policy": config.NameAsIdentifier,
156158
// SecurityConfig can be imported using the AWS-assigned security config ID
@@ -3198,6 +3200,18 @@ func opensearchserverlessCollection() config.ExternalName {
31983200
return e
31993201
}
32003202

3203+
func opensearchserverlessCollectionGroup() config.ExternalName {
3204+
e := config.IdentifierFromProvider
3205+
e.GetIDFn = func(ctx context.Context, externalName string, _ map[string]any, _ map[string]any) (string, error) {
3206+
// [a-z0-9]{3,40}
3207+
if len(externalName) == 0 {
3208+
return "stubcollectiongroup99", nil
3209+
}
3210+
return externalName, nil
3211+
}
3212+
return e
3213+
}
3214+
32013215
// PermissionSetIdAsExternalName uses the id of the permission set (ps-80383020jr9302rk) as the external name, with
32023216
// the comma-separated pair permission_set_arn,instance_arn as the terraform id, when both arns are parameters and known
32033217
// ahead of time.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# SPDX-FileCopyrightText: 2025 The Crossplane Authors <https://crossplane.io>
2+
#
3+
# SPDX-License-Identifier: CC0-1.0
4+
5+
apiVersion: opensearchserverless.aws.upbound.io/v1beta1
6+
kind: CollectionGroup
7+
metadata:
8+
annotations:
9+
meta.upbound.io/example-id: opensearchserverless/v1beta1/collectiongroup
10+
labels:
11+
testing.upbound.io/example-name: example
12+
name: example
13+
spec:
14+
forProvider:
15+
capacityLimits:
16+
- maxIndexingCapacityInOcu: 10
17+
maxSearchCapacityInOcu: 10
18+
minIndexingCapacityInOcu: 0
19+
minSearchCapacityInOcu: 0
20+
description: Scale-to-zero collection group
21+
generation: NEXTGEN
22+
name: example-group
23+
region: us-west-1
24+
standbyReplicas: ENABLED
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# SPDX-FileCopyrightText: 2025 The Crossplane Authors <https://crossplane.io>
2+
#
3+
# SPDX-License-Identifier: CC0-1.0
4+
5+
apiVersion: opensearchserverless.aws.m.upbound.io/v1beta1
6+
kind: CollectionGroup
7+
metadata:
8+
annotations:
9+
meta.upbound.io/example-id: opensearchserverless/v1beta1/collectiongroup
10+
labels:
11+
testing.upbound.io/example-name: example
12+
name: example
13+
namespace: upbound-system
14+
spec:
15+
forProvider:
16+
capacityLimits:
17+
- maxIndexingCapacityInOcu: 10
18+
maxSearchCapacityInOcu: 10
19+
minIndexingCapacityInOcu: 0
20+
minSearchCapacityInOcu: 0
21+
description: Scale-to-zero collection group
22+
generation: NEXTGEN
23+
name: example-group
24+
region: us-west-1
25+
standbyReplicas: ENABLED

0 commit comments

Comments
 (0)