@@ -13,6 +13,7 @@ import (
13
13
"github.com/hashicorp/terraform-plugin-framework/datasource"
14
14
"github.com/hashicorp/terraform-plugin-framework/diag"
15
15
"github.com/hashicorp/terraform-plugin-framework/provider"
16
+ "github.com/hashicorp/terraform-plugin-framework/provider/metaschema"
16
17
"github.com/hashicorp/terraform-plugin-framework/provider/schema"
17
18
"github.com/hashicorp/terraform-plugin-framework/providerserver"
18
19
"github.com/hashicorp/terraform-plugin-framework/resource"
@@ -74,6 +75,7 @@ type tfMongodbAtlasProviderModel struct {
74
75
AwsSecretAccessKeyID types.String `tfsdk:"aws_secret_access_key"`
75
76
AwsSessionToken types.String `tfsdk:"aws_session_token"`
76
77
IsMongodbGovCloud types.Bool `tfsdk:"is_mongodbgov_cloud"`
78
+ EnableAnalytics types.Bool `tfsdk:"enable_analytics"`
77
79
}
78
80
79
81
type tfAssumeRoleModel struct {
@@ -105,6 +107,17 @@ func (p *MongodbtlasProvider) Metadata(ctx context.Context, req provider.Metadat
105
107
resp .Version = version .ProviderVersion
106
108
}
107
109
110
+ func (p * MongodbtlasProvider ) MetaSchema (ctx context.Context , req provider.MetaSchemaRequest , resp * provider.MetaSchemaResponse ) {
111
+ resp .Schema = metaschema.Schema {
112
+ Attributes : map [string ]metaschema.Attribute {
113
+ "script_location" : metaschema.StringAttribute {
114
+ Description : "Example metadata field for analytics/usage." ,
115
+ Optional : true ,
116
+ },
117
+ },
118
+ }
119
+ }
120
+
108
121
func (p * MongodbtlasProvider ) Schema (ctx context.Context , req provider.SchemaRequest , resp * provider.SchemaResponse ) {
109
122
resp .Schema = schema.Schema {
110
123
Blocks : map [string ]schema.Block {
@@ -156,6 +169,10 @@ func (p *MongodbtlasProvider) Schema(ctx context.Context, req provider.SchemaReq
156
169
Optional : true ,
157
170
Description : "AWS Security Token Service provided session token." ,
158
171
},
172
+ "enable_analytics" : schema.BoolAttribute {
173
+ Optional : true ,
174
+ Description : "Allow extra user agent headers such as script_location specified in provider_meta blocks." ,
175
+ },
159
176
},
160
177
}
161
178
}
@@ -245,6 +262,7 @@ func (p *MongodbtlasProvider) Configure(ctx context.Context, req provider.Config
245
262
RealmBaseURL : data .RealmBaseURL .ValueString (),
246
263
TerraformVersion : req .TerraformVersion ,
247
264
PreviewV2AdvancedClusterEnabled : config .PreviewProviderV2AdvancedCluster (),
265
+ AnalyticsEnabled : data .EnableAnalytics .ValueBool (),
248
266
}
249
267
250
268
var assumeRoles []tfAssumeRoleModel
0 commit comments