in ec/ecresource/elasticsearchkeystoreresource/schema.go [39:89]
func (r *Resource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) {
resp.Schema = schema.Schema{
Description: `Provides an Elastic Cloud Deployment Elasticsearch keystore resource, which allows you to create and update Elasticsearch keystore settings.
Elasticsearch keystore settings can be created and updated through this resource, **each resource represents a single Elasticsearch Keystore setting**. After adding a key and its secret value to the keystore, you can use the key in place of the secret value when you configure sensitive settings.
~> **Note on Elastic keystore settings** This resource offers weaker consistency guarantees and will not detect and update keystore setting values that have been modified outside of the scope of Terraform, usually referred to as _drift_. For example, consider the following scenario:
1. A keystore setting is created using this resource.
2. The keystore setting's value is modified to a different value using the Elasticsearch Service API.
3. Running <code>terraform apply</code> fails to detect the changes and does not update the keystore setting to the value defined in the terraform configuration.
To force the keystore setting to the value it is configured to hold, you may want to taint the resource and force its recreation.
Before you create Elasticsearch keystore settings, check the [official Elasticsearch keystore documentation](https://www.elastic.co/guide/en/elasticsearch/reference/master/elasticsearch-keystore.html) and the [Elastic Cloud specific documentation](https://www.elastic.co/guide/en/cloud/current/ec-configuring-keystore.html).`,
Attributes: map[string]schema.Attribute{
"id": schema.StringAttribute{
MarkdownDescription: "Unique identifier of this resource.",
Computed: true,
PlanModifiers: []planmodifier.String{
stringplanmodifier.UseStateForUnknown(),
},
},
"deployment_id": schema.StringAttribute{
Description: `Deployment ID of the Deployment that holds the Elasticsearch cluster where the keystore setting will be written to.`,
Required: true,
PlanModifiers: []planmodifier.String{
stringplanmodifier.RequiresReplace(),
},
},
"setting_name": schema.StringAttribute{
Description: "Name for the keystore setting, if the setting already exists in the Elasticsearch cluster, it will be overridden.",
Required: true,
PlanModifiers: []planmodifier.String{
stringplanmodifier.RequiresReplace(),
},
},
"value": schema.StringAttribute{
Description: "Value of this setting. This can either be a string or a JSON object that is stored as a JSON string in the keystore.",
Sensitive: true,
Required: true,
},
"as_file": schema.BoolAttribute{
Description: "Indicates the the remote keystore setting should be stored as a file. The default is false, which stores the keystore setting as string when value is a plain string.",
Optional: true,
Computed: true,
PlanModifiers: []planmodifier.Bool{
planmodifiers.BoolDefaultValue(false),
},
},
},
}
}