Skip to content

Commit bb2d897

Browse files
committed
Add aws_opensearchserverless_collection_group resource
Signed-off-by: Federico <github-fed-sv.unrigged670@passmail.com>
1 parent 449eede commit bb2d897

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
@@ -170,6 +170,8 @@ var TerraformPluginFrameworkExternalNameConfigs = map[string]config.ExternalName
170170
"aws_opensearchserverless_access_policy": config.NameAsIdentifier,
171171
// Collection can be imported using the AWS-assigned collection ID. i.e. ch9rq91uv4yd8rff1f39
172172
"aws_opensearchserverless_collection": opensearchserverlessCollection(),
173+
// CollectionGroup can be imported using the AWS-assigned collection group ID
174+
"aws_opensearchserverless_collection_group": opensearchserverlessCollectionGroup(),
173175
// LifecyclePolicy can be imported using the policy name
174176
"aws_opensearchserverless_lifecycle_policy": config.NameAsIdentifier,
175177
// SecurityConfig can be imported using the AWS-assigned security config ID
@@ -3217,6 +3219,18 @@ func opensearchserverlessCollection() config.ExternalName {
32173219
return e
32183220
}
32193221

3222+
func opensearchserverlessCollectionGroup() config.ExternalName {
3223+
e := config.IdentifierFromProvider
3224+
e.GetIDFn = func(ctx context.Context, externalName string, _ map[string]any, _ map[string]any) (string, error) {
3225+
// [a-z0-9]{3,40}
3226+
if len(externalName) == 0 {
3227+
return "stubcollectiongroup99", nil
3228+
}
3229+
return externalName, nil
3230+
}
3231+
return e
3232+
}
3233+
32203234
// PermissionSetIdAsExternalName uses the id of the permission set (ps-80383020jr9302rk) as the external name, with
32213235
// the comma-separated pair permission_set_arn,instance_arn as the terraform id, when both arns are parameters and known
32223236
// 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)