in internal/services/azapi_resource_id_data_source.go [44:112]
func (r *ResourceIdDataSource) Schema(ctx context.Context, request datasource.SchemaRequest, response *datasource.SchemaResponse) {
response.Schema = schema.Schema{
Attributes: map[string]schema.Attribute{
"id": schema.StringAttribute{
Computed: true,
MarkdownDescription: docstrings.ID(),
},
"type": schema.StringAttribute{
Required: true,
Validators: []validator.String{
myvalidator.StringIsResourceType(),
},
MarkdownDescription: docstrings.Type(),
},
"parent_id": schema.StringAttribute{
Optional: true,
Computed: true,
Validators: []validator.String{
myvalidator.StringIsResourceID(),
},
MarkdownDescription: docstrings.ParentID(),
},
"name": schema.StringAttribute{
Optional: true,
Computed: true,
MarkdownDescription: "The name of the Azure resource.",
},
"resource_id": schema.StringAttribute{
Optional: true,
Computed: true,
Validators: []validator.String{
myvalidator.StringIsResourceID(),
},
MarkdownDescription: "The ID of an existing Azure source.",
},
"resource_group_name": schema.StringAttribute{
Computed: true,
MarkdownDescription: "The resource group name of the Azure resource.",
},
"subscription_id": schema.StringAttribute{
Computed: true,
MarkdownDescription: "The subscription ID of the Azure resource.",
},
"provider_namespace": schema.StringAttribute{
Computed: true,
MarkdownDescription: "The Azure resource provider namespace of the Azure resource.",
},
"parts": schema.MapAttribute{
Computed: true,
ElementType: types.StringType,
MarkdownDescription: "A map of the resource ID parts, where the key is the part name and the value is the part value. e.g. `virtualNetworks=myVnet`.",
},
},
Blocks: map[string]schema.Block{
"timeouts": timeouts.Block(ctx, timeouts.Opts{
Read: true,
}),
},
}
}