generated from hashicorp/terraform-provider-scaffolding
/
parameter_singular_data_source_gen.go
181 lines (168 loc) · 7.45 KB
/
parameter_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
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
// Code generated by generators/singular-data-source/main.go; DO NOT EDIT.
package ssm
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_ssm_parameter", parameterDataSource)
}
// parameterDataSource returns the Terraform awscc_ssm_parameter data source.
// This Terraform data source corresponds to the CloudFormation AWS::SSM::Parameter resource.
func parameterDataSource(ctx context.Context) (datasource.DataSource, error) {
attributes := map[string]schema.Attribute{ /*START SCHEMA*/
// Property: AllowedPattern
// CloudFormation resource type schema:
//
// {
// "description": "A regular expression used to validate the parameter value. For example, for ``String`` types with values restricted to numbers, you can specify the following: ``AllowedPattern=^\\d+$``",
// "type": "string"
// }
"allowed_pattern": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "A regular expression used to validate the parameter value. For example, for ``String`` types with values restricted to numbers, you can specify the following: ``AllowedPattern=^\\d+$``",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: DataType
// CloudFormation resource type schema:
//
// {
// "description": "The data type of the parameter, such as ``text`` or ``aws:ec2:image``. The default is ``text``.",
// "enum": [
// "text",
// "aws:ec2:image"
// ],
// "type": "string"
// }
"data_type": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The data type of the parameter, such as ``text`` or ``aws:ec2:image``. The default is ``text``.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Description
// CloudFormation resource type schema:
//
// {
// "description": "Information about the parameter.",
// "type": "string"
// }
"description": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "Information about the parameter.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Name
// CloudFormation resource type schema:
//
// {
// "description": "The name of the parameter.\n The maximum length constraint listed below includes capacity for additional system attributes that aren't part of the name. The maximum length for a parameter name, including the full length of the parameter Amazon Resource Name (ARN), is 1011 characters. For example, the length of the following parameter name is 65 characters, not 20 characters: ``arn:aws:ssm:us-east-2:111222333444:parameter/ExampleParameterName``",
// "type": "string"
// }
"name": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The name of the parameter.\n The maximum length constraint listed below includes capacity for additional system attributes that aren't part of the name. The maximum length for a parameter name, including the full length of the parameter Amazon Resource Name (ARN), is 1011 characters. For example, the length of the following parameter name is 65 characters, not 20 characters: ``arn:aws:ssm:us-east-2:111222333444:parameter/ExampleParameterName``",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Policies
// CloudFormation resource type schema:
//
// {
// "description": "Information about the policies assigned to a parameter.\n [Assigning parameter policies](https://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-store-policies.html) in the *User Guide*.",
// "type": "string"
// }
"policies": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "Information about the policies assigned to a parameter.\n [Assigning parameter policies](https://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-store-policies.html) in the *User Guide*.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Tags
// CloudFormation resource type schema:
//
// {
// "additionalProperties": false,
// "description": "Optional metadata that you assign to a resource in the form of an arbitrary set of tags (key-value pairs). Tags enable you to categorize a resource in different ways, such as by purpose, owner, or environment. For example, you might want to tag a SYS parameter to identify the type of resource to which it applies, the environment, or the type of configuration data referenced by the parameter.",
// "patternProperties": {
// "": {
// "type": "string"
// }
// },
// "type": "object"
// }
"tags": // Pattern: ""
schema.MapAttribute{ /*START ATTRIBUTE*/
ElementType: types.StringType,
Description: "Optional metadata that you assign to a resource in the form of an arbitrary set of tags (key-value pairs). Tags enable you to categorize a resource in different ways, such as by purpose, owner, or environment. For example, you might want to tag a SYS parameter to identify the type of resource to which it applies, the environment, or the type of configuration data referenced by the parameter.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Tier
// CloudFormation resource type schema:
//
// {
// "description": "The parameter tier.",
// "enum": [
// "Standard",
// "Advanced",
// "Intelligent-Tiering"
// ],
// "type": "string"
// }
"tier": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The parameter tier.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Type
// CloudFormation resource type schema:
//
// {
// "description": "The type of parameter.",
// "enum": [
// "String",
// "StringList"
// ],
// "type": "string"
// }
"type": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The type of parameter.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Value
// CloudFormation resource type schema:
//
// {
// "description": "The parameter value.\n If type is ``StringList``, the system returns a comma-separated string with no spaces between commas in the ``Value`` field.",
// "type": "string"
// }
"value": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The parameter value.\n If type is ``StringList``, the system returns a comma-separated string with no spaces between commas in the ``Value`` field.",
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::SSM::Parameter",
Attributes: attributes,
}
var opts generic.DataSourceOptions
opts = opts.WithCloudFormationTypeName("AWS::SSM::Parameter").WithTerraformTypeName("awscc_ssm_parameter")
opts = opts.WithTerraformSchema(schema)
opts = opts.WithAttributeNameMap(map[string]string{
"allowed_pattern": "AllowedPattern",
"data_type": "DataType",
"description": "Description",
"name": "Name",
"policies": "Policies",
"tags": "Tags",
"tier": "Tier",
"type": "Type",
"value": "Value",
})
v, err := generic.NewSingularDataSource(ctx, opts...)
if err != nil {
return nil, err
}
return v, nil
}