generated from hashicorp/terraform-provider-scaffolding
/
access_point_singular_data_source_gen.go
235 lines (222 loc) · 12.8 KB
/
access_point_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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
// Code generated by generators/singular-data-source/main.go; DO NOT EDIT.
package s3
import (
"context"
"github.com/hashicorp/terraform-plugin-framework-jsontypes/jsontypes"
"github.com/hashicorp/terraform-plugin-framework/datasource"
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
"github.com/hashicorp/terraform-provider-awscc/internal/generic"
"github.com/hashicorp/terraform-provider-awscc/internal/registry"
)
func init() {
registry.AddDataSourceFactory("awscc_s3_access_point", accessPointDataSource)
}
// accessPointDataSource returns the Terraform awscc_s3_access_point data source.
// This Terraform data source corresponds to the CloudFormation AWS::S3::AccessPoint resource.
func accessPointDataSource(ctx context.Context) (datasource.DataSource, error) {
attributes := map[string]schema.Attribute{ /*START SCHEMA*/
// Property: Alias
// CloudFormation resource type schema:
//
// {
// "description": "The alias of this Access Point. This alias can be used for compatibility purposes with other AWS services and third-party applications.",
// "maxLength": 63,
// "minLength": 3,
// "pattern": "^[a-z0-9]([a-z0-9\\-]*[a-z0-9])?$",
// "type": "string"
// }
"alias": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The alias of this Access Point. This alias can be used for compatibility purposes with other AWS services and third-party applications.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Arn
// CloudFormation resource type schema:
//
// {
// "description": "The Amazon Resource Name (ARN) of the specified accesspoint.",
// "type": "string"
// }
"arn": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The Amazon Resource Name (ARN) of the specified accesspoint.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Bucket
// CloudFormation resource type schema:
//
// {
// "description": "The name of the bucket that you want to associate this Access Point with.",
// "maxLength": 255,
// "minLength": 3,
// "type": "string"
// }
"bucket": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The name of the bucket that you want to associate this Access Point with.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: BucketAccountId
// CloudFormation resource type schema:
//
// {
// "description": "The AWS account ID associated with the S3 bucket associated with this access point.",
// "maxLength": 64,
// "pattern": "^\\d{12}$",
// "type": "string"
// }
"bucket_account_id": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The AWS account ID associated with the S3 bucket associated with this access point.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Name
// CloudFormation resource type schema:
//
// {
// "description": "The name you want to assign to this Access Point. If you don't specify a name, AWS CloudFormation generates a unique ID and uses that ID for the access point name.",
// "maxLength": 50,
// "minLength": 3,
// "pattern": "^[a-z0-9]([a-z0-9\\-]*[a-z0-9])?$",
// "type": "string"
// }
"name": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The name you want to assign to this Access Point. If you don't specify a name, AWS CloudFormation generates a unique ID and uses that ID for the access point name.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: NetworkOrigin
// CloudFormation resource type schema:
//
// {
// "description": "Indicates whether this Access Point allows access from the public Internet. If VpcConfiguration is specified for this Access Point, then NetworkOrigin is VPC, and the Access Point doesn't allow access from the public Internet. Otherwise, NetworkOrigin is Internet, and the Access Point allows access from the public Internet, subject to the Access Point and bucket access policies.",
// "enum": [
// "Internet",
// "VPC"
// ],
// "type": "string"
// }
"network_origin": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "Indicates whether this Access Point allows access from the public Internet. If VpcConfiguration is specified for this Access Point, then NetworkOrigin is VPC, and the Access Point doesn't allow access from the public Internet. Otherwise, NetworkOrigin is Internet, and the Access Point allows access from the public Internet, subject to the Access Point and bucket access policies.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Policy
// CloudFormation resource type schema:
//
// {
// "description": "The Access Point Policy you want to apply to this access point.",
// "type": "object"
// }
"policy": schema.StringAttribute{ /*START ATTRIBUTE*/
CustomType: jsontypes.NormalizedType{},
Description: "The Access Point Policy you want to apply to this access point.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: PublicAccessBlockConfiguration
// CloudFormation resource type schema:
//
// {
// "description": "The PublicAccessBlock configuration that you want to apply to this Access Point. You can enable the configuration options in any combination. For more information about when Amazon S3 considers a bucket or object public, see https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status 'The Meaning of Public' in the Amazon Simple Storage Service Developer Guide.",
// "properties": {
// "BlockPublicAcls": {
// "description": "Specifies whether Amazon S3 should block public access control lists (ACLs) for buckets in this account. Setting this element to TRUE causes the following behavior:\n- PUT Bucket acl and PUT Object acl calls fail if the specified ACL is public.\n - PUT Object calls fail if the request includes a public ACL.\n. - PUT Bucket calls fail if the request includes a public ACL.\nEnabling this setting doesn't affect existing policies or ACLs.",
// "type": "boolean"
// },
// "BlockPublicPolicy": {
// "description": "Specifies whether Amazon S3 should block public bucket policies for buckets in this account. Setting this element to TRUE causes Amazon S3 to reject calls to PUT Bucket policy if the specified bucket policy allows public access. Enabling this setting doesn't affect existing bucket policies.",
// "type": "boolean"
// },
// "IgnorePublicAcls": {
// "description": "Specifies whether Amazon S3 should ignore public ACLs for buckets in this account. Setting this element to TRUE causes Amazon S3 to ignore all public ACLs on buckets in this account and any objects that they contain. Enabling this setting doesn't affect the persistence of any existing ACLs and doesn't prevent new public ACLs from being set.",
// "type": "boolean"
// },
// "RestrictPublicBuckets": {
// "description": "Specifies whether Amazon S3 should restrict public bucket policies for this bucket. Setting this element to TRUE restricts access to this bucket to only AWS services and authorized users within this account if the bucket has a public policy.\nEnabling this setting doesn't affect previously stored bucket policies, except that public and cross-account access within any public bucket policy, including non-public delegation to specific accounts, is blocked.",
// "type": "boolean"
// }
// },
// "type": "object"
// }
"public_access_block_configuration": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: BlockPublicAcls
"block_public_acls": schema.BoolAttribute{ /*START ATTRIBUTE*/
Description: "Specifies whether Amazon S3 should block public access control lists (ACLs) for buckets in this account. Setting this element to TRUE causes the following behavior:\n- PUT Bucket acl and PUT Object acl calls fail if the specified ACL is public.\n - PUT Object calls fail if the request includes a public ACL.\n. - PUT Bucket calls fail if the request includes a public ACL.\nEnabling this setting doesn't affect existing policies or ACLs.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: BlockPublicPolicy
"block_public_policy": schema.BoolAttribute{ /*START ATTRIBUTE*/
Description: "Specifies whether Amazon S3 should block public bucket policies for buckets in this account. Setting this element to TRUE causes Amazon S3 to reject calls to PUT Bucket policy if the specified bucket policy allows public access. Enabling this setting doesn't affect existing bucket policies.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: IgnorePublicAcls
"ignore_public_acls": schema.BoolAttribute{ /*START ATTRIBUTE*/
Description: "Specifies whether Amazon S3 should ignore public ACLs for buckets in this account. Setting this element to TRUE causes Amazon S3 to ignore all public ACLs on buckets in this account and any objects that they contain. Enabling this setting doesn't affect the persistence of any existing ACLs and doesn't prevent new public ACLs from being set.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: RestrictPublicBuckets
"restrict_public_buckets": schema.BoolAttribute{ /*START ATTRIBUTE*/
Description: "Specifies whether Amazon S3 should restrict public bucket policies for this bucket. Setting this element to TRUE restricts access to this bucket to only AWS services and authorized users within this account if the bucket has a public policy.\nEnabling this setting doesn't affect previously stored bucket policies, except that public and cross-account access within any public bucket policy, including non-public delegation to specific accounts, is blocked.",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Description: "The PublicAccessBlock configuration that you want to apply to this Access Point. You can enable the configuration options in any combination. For more information about when Amazon S3 considers a bucket or object public, see https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status 'The Meaning of Public' in the Amazon Simple Storage Service Developer Guide.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: VpcConfiguration
// CloudFormation resource type schema:
//
// {
// "description": "If you include this field, Amazon S3 restricts access to this Access Point to requests from the specified Virtual Private Cloud (VPC).",
// "properties": {
// "VpcId": {
// "description": "If this field is specified, this access point will only allow connections from the specified VPC ID.",
// "maxLength": 1024,
// "minLength": 1,
// "type": "string"
// }
// },
// "type": "object"
// }
"vpc_configuration": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: VpcId
"vpc_id": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "If this field is specified, this access point will only allow connections from the specified VPC ID.",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Description: "If you include this field, Amazon S3 restricts access to this Access Point to requests from the specified Virtual Private Cloud (VPC).",
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::S3::AccessPoint",
Attributes: attributes,
}
var opts generic.DataSourceOptions
opts = opts.WithCloudFormationTypeName("AWS::S3::AccessPoint").WithTerraformTypeName("awscc_s3_access_point")
opts = opts.WithTerraformSchema(schema)
opts = opts.WithAttributeNameMap(map[string]string{
"alias": "Alias",
"arn": "Arn",
"block_public_acls": "BlockPublicAcls",
"block_public_policy": "BlockPublicPolicy",
"bucket": "Bucket",
"bucket_account_id": "BucketAccountId",
"ignore_public_acls": "IgnorePublicAcls",
"name": "Name",
"network_origin": "NetworkOrigin",
"policy": "Policy",
"public_access_block_configuration": "PublicAccessBlockConfiguration",
"restrict_public_buckets": "RestrictPublicBuckets",
"vpc_configuration": "VpcConfiguration",
"vpc_id": "VpcId",
})
v, err := generic.NewSingularDataSource(ctx, opts...)
if err != nil {
return nil, err
}
return v, nil
}