func DeploymentSchema()

in ec/ecresource/deploymentresource/deployment/v2/schema.go [38:149]


func DeploymentSchema() schema.Schema {
	return schema.Schema{
		Version:             2,
		MarkdownDescription: "Provides an Elastic Cloud deployment resource, which allows deployments to be created, updated, and deleted.",

		Attributes: map[string]schema.Attribute{
			"id": schema.StringAttribute{
				Computed:            true,
				MarkdownDescription: "Unique identifier of this deployment.",
				PlanModifiers: []planmodifier.String{
					stringplanmodifier.UseStateForUnknown(),
				},
			},
			"alias": schema.StringAttribute{
				Computed:    true,
				Optional:    true,
				Description: "Deployment alias, affects the format of the resource URLs. Set to an empty value (\"\") to disable the alias.",
				PlanModifiers: []planmodifier.String{
					stringplanmodifier.UseStateForUnknown(),
				},
			},
			"version": schema.StringAttribute{
				Description: `Elastic Stack version to use for all of the deployment resources.

-> Read the [ESS stack version policy](https://www.elastic.co/guide/en/cloud/current/ec-version-policy.html#ec-version-policy-available) to understand which versions are available.`,
				Required: true,
				Validators: []validator.String{
					isVersion{},
				},
			},
			"region": schema.StringAttribute{
				Description: "Elasticsearch Service (ESS) region where the deployment should be hosted. For Elastic Cloud Enterprise (ECE) installations, set to `\"ece-region\".",
				Required:    true,
			},
			"deployment_template_id": schema.StringAttribute{
				Description: "Deployment template identifier to create the deployment from. See the [full list](https://www.elastic.co/guide/en/cloud/current/ec-regions-templates-instances.html) of regions and deployment templates available in ESS.",
				Required:    true,
			},
			"name": schema.StringAttribute{
				Description: "Name for the deployment",
				Optional:    true,
			},
			"request_id": schema.StringAttribute{
				Description: "Request ID to set when you create the deployment. Use it only when previous attempts return an error and `request_id` is returned as part of the error.",
				Optional:    true,
				Computed:    true,
				PlanModifiers: []planmodifier.String{
					stringplanmodifier.UseStateForUnknown(),
				},
			},
			"elasticsearch_username": schema.StringAttribute{
				Description: "Username for authenticating to the Elasticsearch resource.",
				Computed:    true,
				PlanModifiers: []planmodifier.String{
					stringplanmodifier.UseStateForUnknown(),
					setUnknownIfResetPasswordIsTrue{},
				},
			},
			"elasticsearch_password": schema.StringAttribute{
				Description: `Password for authenticating to the Elasticsearch resource.

~> **Note on deployment credentials** The <code>elastic</code> user credentials are only available whilst creating a deployment. Importing a deployment will not import the <code>elasticsearch_username</code> or <code>elasticsearch_password</code> attributes.
~> **Note on deployment credentials in state** The <code>elastic</code> user credentials are stored in the state file as plain text. Please follow the official Terraform recommendations regarding senstaive data in state.`,
				Computed:  true,
				Sensitive: true,
				PlanModifiers: []planmodifier.String{
					stringplanmodifier.UseStateForUnknown(),
					setUnknownIfResetPasswordIsTrue{},
				},
			},
			"apm_secret_token": schema.StringAttribute{
				Computed:  true,
				Sensitive: true,
				PlanModifiers: []planmodifier.String{
					stringplanmodifier.UseStateForUnknown(),
					UseNullUnlessAddingAPMOrIntegrationsServer(),
				},
			},
			"traffic_filter": schema.SetAttribute{
				ElementType: types.StringType,
				Optional:    true,
				Computed:    true,
				Description: "List of traffic filters rule identifiers that will be applied to the deployment.",
				PlanModifiers: []planmodifier.Set{
					planmodifiers.SetDefaultValue(types.StringType, []attr.Value{}),
				},
			},
			"tags": schema.MapAttribute{
				Description: "Optional map of deployment tags",
				ElementType: types.StringType,
				Optional:    true,
			},
			"reset_elasticsearch_password": schema.BoolAttribute{
				Description: "Explicitly resets the elasticsearch_password when true",
				Optional:    true,
			},
			"migrate_to_latest_hardware": schema.BoolAttribute{
				Description: `When set to true, the deployment will be updated according to the latest deployment template values.

~> **Note** If the <code>instance_configuration_id</code> or <code>instance_configuration_version</code> fields are set for a specific topology element, that element will not be updated.
~> **Note** Hardware migrations are not supported for deployments with node types. To use this field, the deployment needs to be migrated to node roles first.`,
				Optional: true,
			},
			"elasticsearch":       elasticsearchv2.ElasticsearchSchema(),
			"kibana":              kibanav2.KibanaSchema(),
			"apm":                 apmv2.ApmSchema(),
			"integrations_server": integrationsserverv2.IntegrationsServerSchema(),
			"enterprise_search":   enterprisesearchv2.EnterpriseSearchSchema(),
			"observability":       observabilityv2.ObservabilitySchema(),
		},
	}
}