generated from hashicorp/terraform-provider-scaffolding
/
protection_group_singular_data_source_gen.go
206 lines (193 loc) · 10.1 KB
/
protection_group_singular_data_source_gen.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
// Code generated by generators/singular-data-source/main.go; DO NOT EDIT.
package shield
import (
"context"
"github.com/hashicorp/terraform-plugin-framework/datasource"
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
"github.com/hashicorp/terraform-plugin-framework/types"
"github.com/hashicorp/terraform-provider-awscc/internal/generic"
"github.com/hashicorp/terraform-provider-awscc/internal/registry"
)
func init() {
registry.AddDataSourceFactory("awscc_shield_protection_group", protectionGroupDataSource)
}
// protectionGroupDataSource returns the Terraform awscc_shield_protection_group data source.
// This Terraform data source corresponds to the CloudFormation AWS::Shield::ProtectionGroup resource.
func protectionGroupDataSource(ctx context.Context) (datasource.DataSource, error) {
attributes := map[string]schema.Attribute{ /*START SCHEMA*/
// Property: Aggregation
// CloudFormation resource type schema:
//
// {
// "description": "Defines how AWS Shield combines resource data for the group in order to detect, mitigate, and report events.\n* Sum - Use the total traffic across the group. This is a good choice for most cases. Examples include Elastic IP addresses for EC2 instances that scale manually or automatically.\n* Mean - Use the average of the traffic across the group. This is a good choice for resources that share traffic uniformly. Examples include accelerators and load balancers.\n* Max - Use the highest traffic from each resource. This is useful for resources that don't share traffic and for resources that share that traffic in a non-uniform way. Examples include Amazon CloudFront and origin resources for CloudFront distributions.",
// "enum": [
// "SUM",
// "MEAN",
// "MAX"
// ],
// "type": "string"
// }
"aggregation": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "Defines how AWS Shield combines resource data for the group in order to detect, mitigate, and report events.\n* Sum - Use the total traffic across the group. This is a good choice for most cases. Examples include Elastic IP addresses for EC2 instances that scale manually or automatically.\n* Mean - Use the average of the traffic across the group. This is a good choice for resources that share traffic uniformly. Examples include accelerators and load balancers.\n* Max - Use the highest traffic from each resource. This is useful for resources that don't share traffic and for resources that share that traffic in a non-uniform way. Examples include Amazon CloudFront and origin resources for CloudFront distributions.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Members
// CloudFormation resource type schema:
//
// {
// "description": "The Amazon Resource Names (ARNs) of the resources to include in the protection group. You must set this when you set `Pattern` to `ARBITRARY` and you must not set it for any other `Pattern` setting.",
// "insertionOrder": false,
// "items": {
// "maxLength": 2048,
// "minLength": 1,
// "type": "string"
// },
// "maxItems": 10000,
// "type": "array"
// }
"members": schema.ListAttribute{ /*START ATTRIBUTE*/
ElementType: types.StringType,
Description: "The Amazon Resource Names (ARNs) of the resources to include in the protection group. You must set this when you set `Pattern` to `ARBITRARY` and you must not set it for any other `Pattern` setting.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Pattern
// CloudFormation resource type schema:
//
// {
// "description": "The criteria to use to choose the protected resources for inclusion in the group. You can include all resources that have protections, provide a list of resource Amazon Resource Names (ARNs), or include all resources of a specified resource type.",
// "enum": [
// "ALL",
// "ARBITRARY",
// "BY_RESOURCE_TYPE"
// ],
// "type": "string"
// }
"pattern": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The criteria to use to choose the protected resources for inclusion in the group. You can include all resources that have protections, provide a list of resource Amazon Resource Names (ARNs), or include all resources of a specified resource type.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: ProtectionGroupArn
// CloudFormation resource type schema:
//
// {
// "description": "The ARN (Amazon Resource Name) of the protection group.",
// "type": "string"
// }
"protection_group_arn": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The ARN (Amazon Resource Name) of the protection group.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: ProtectionGroupId
// CloudFormation resource type schema:
//
// {
// "description": "The name of the protection group. You use this to identify the protection group in lists and to manage the protection group, for example to update, delete, or describe it.",
// "maxLength": 36,
// "minLength": 1,
// "pattern": "[a-zA-Z0-9\\-]*",
// "type": "string"
// }
"protection_group_id": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The name of the protection group. You use this to identify the protection group in lists and to manage the protection group, for example to update, delete, or describe it.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: ResourceType
// CloudFormation resource type schema:
//
// {
// "description": "The resource type to include in the protection group. All protected resources of this type are included in the protection group. Newly protected resources of this type are automatically added to the group. You must set this when you set `Pattern` to `BY_RESOURCE_TYPE` and you must not set it for any other `Pattern` setting.",
// "enum": [
// "CLOUDFRONT_DISTRIBUTION",
// "ROUTE_53_HOSTED_ZONE",
// "ELASTIC_IP_ALLOCATION",
// "CLASSIC_LOAD_BALANCER",
// "APPLICATION_LOAD_BALANCER",
// "GLOBAL_ACCELERATOR"
// ],
// "type": "string"
// }
"resource_type": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The resource type to include in the protection group. All protected resources of this type are included in the protection group. Newly protected resources of this type are automatically added to the group. You must set this when you set `Pattern` to `BY_RESOURCE_TYPE` and you must not set it for any other `Pattern` setting.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Tags
// CloudFormation resource type schema:
//
// {
// "description": "One or more tag key-value pairs for the Protection object.",
// "insertionOrder": false,
// "items": {
// "additionalProperties": false,
// "description": "A tag associated with an AWS resource. Tags are key:value pairs that you can use to categorize and manage your resources, for purposes like billing or other management. Typically, the tag key represents a category, such as \"environment\", and the tag value represents a specific value within that category, such as \"test,\" \"development,\" or \"production\". Or you might set the tag key to \"customer\" and the value to the customer name or ID. You can specify one or more tags to add to each AWS resource, up to 50 tags for a resource.",
// "properties": {
// "Key": {
// "description": "Part of the key:value pair that defines a tag. You can use a tag key to describe a category of information, such as \"customer.\" Tag keys are case-sensitive.",
// "maxLength": 128,
// "minLength": 1,
// "type": "string"
// },
// "Value": {
// "description": "Part of the key:value pair that defines a tag. You can use a tag value to describe a specific value within a category, such as \"companyA\" or \"companyB.\" Tag values are case-sensitive.",
// "maxLength": 256,
// "minLength": 0,
// "type": "string"
// }
// },
// "required": [
// "Key",
// "Value"
// ],
// "type": "object"
// },
// "maxItems": 200,
// "type": "array"
// }
"tags": schema.ListNestedAttribute{ /*START ATTRIBUTE*/
NestedObject: schema.NestedAttributeObject{ /*START NESTED OBJECT*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: Key
"key": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "Part of the key:value pair that defines a tag. You can use a tag key to describe a category of information, such as \"customer.\" Tag keys are case-sensitive.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Value
"value": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "Part of the key:value pair that defines a tag. You can use a tag value to describe a specific value within a category, such as \"companyA\" or \"companyB.\" Tag values are case-sensitive.",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
}, /*END NESTED OBJECT*/
Description: "One or more tag key-value pairs for the Protection object.",
Computed: true,
}, /*END ATTRIBUTE*/
} /*END SCHEMA*/
attributes["id"] = schema.StringAttribute{
Description: "Uniquely identifies the resource.",
Required: true,
}
schema := schema.Schema{
Description: "Data Source schema for AWS::Shield::ProtectionGroup",
Attributes: attributes,
}
var opts generic.DataSourceOptions
opts = opts.WithCloudFormationTypeName("AWS::Shield::ProtectionGroup").WithTerraformTypeName("awscc_shield_protection_group")
opts = opts.WithTerraformSchema(schema)
opts = opts.WithAttributeNameMap(map[string]string{
"aggregation": "Aggregation",
"key": "Key",
"members": "Members",
"pattern": "Pattern",
"protection_group_arn": "ProtectionGroupArn",
"protection_group_id": "ProtectionGroupId",
"resource_type": "ResourceType",
"tags": "Tags",
"value": "Value",
})
v, err := generic.NewSingularDataSource(ctx, opts...)
if err != nil {
return nil, err
}
return v, nil
}