Documentation
¶
Overview ¶
Package schema defines the schemas of all the resources and data sources of the CloudSecure Terraform provider, which form the Illumio CloudSecure Config API.
Index ¶
- Constants
- Variables
- func AttributeIsOptional(attribute any) bool
- func ProtoMessageName(tfName string) string
- func ProtoMessageNameForCreateRequest(camelCaseResourcename string) string
- func ProtoMessageNameForCreateResponse(camelCaseResourcename string) string
- func ProtoMessageNameForDeleteRequest(camelCaseResourcename string) string
- func ProtoMessageNameForReadRequest(camelCaseResourcename string) string
- func ProtoMessageNameForReadResponse(camelCaseResourcename string) string
- func ProtoMessageNameForUpdateRequest(camelCaseResourcename string) string
- func ProtoMessageNameForUpdateResponse(camelCaseResourcename string) string
- func RPCNameForCreate(camelCaseResourcename string) string
- func RPCNameForDelete(camelCaseResourcename string) string
- func RPCNameForRead(camelCaseResourcename string) string
- func RPCNameForUpdate(camelCaseResourcename string) string
- func SortDataSourceAttributes(attrs map[string]datasource_schema.Attribute) []string
- func SortObjectAttributes(attrs map[string]attr.Type) []string
- func SortResourceAttributes(attrs map[string]resource_schema.Attribute) []string
- type AttributeMode
- type AttributeWithMode
- type BoolResourceAttributeWithMode
- type DataSource
- type DataSources
- type Float32ResourceAttributeWithMode
- type Float64ResourceAttributeWithMode
- type Int32ResourceAttributeWithMode
- type Int64ResourceAttributeWithMode
- type ListNestedResourceAttributeWithMode
- type ListResourceAttributeWithMode
- type MapResourceAttributeWithMode
- type NumberResourceAttributeWithMode
- type ObjectResourceAttributeWithMode
- type Resource
- type Resources
- type Schema
- type SetResourceAttributeWithMode
- type StringResourceAttributeWithMode
Constants ¶
const ( // IDFieldName is the name of the "id" attribute/field that is used to identify any Illumio CloudSecure resource or data source. IDFieldName = "id" // UpdateMaskFieldName is the name of the "update_mask" field used in resource update requests to list the fields modified by the operation. UpdateMaskFieldName = "update_mask" )
Variables ¶
var ( // KeyAttributeMode is the mode of attributes that are used to identify resource instances. KeyAttributeMode = AttributeMode{ InCreateRequest: true, InCreateResponse: true, InReadRequest: true, InReadResponse: true, InUpdateRequest: true, InUpdateResponse: true, InDeleteRequest: true, } // IDAttributeMode is the mode of "id" attributes. IDAttributeMode = AttributeMode{ InCreateResponse: true, InReadRequest: true, InReadResponse: true, InUpdateRequest: true, InUpdateResponse: true, InDeleteRequest: true, } // ReadWriteAttributeMode is the mode of read-write attributes. This is the default mode. ReadWriteAttributeMode = AttributeMode{ InCreateRequest: true, InCreateResponse: true, InReadResponse: true, InUpdateRequest: true, InUpdateResponse: true, } // ImmutableAttributeMode is the mode of immutable attributes, which can be set only at creation and can be read afterwards. // Attributes with this mode should also have the RequiresReplace plan modifier. ImmutableAttributeMode = AttributeMode{ InCreateRequest: true, InCreateResponse: true, InReadResponse: true, InUpdateResponse: true, } // ReadOnlyAttributeMode is the mode of read-only attributes, which are returned by every create, read, and update operation. ReadOnlyAttributeMode = AttributeMode{ InCreateResponse: true, InReadResponse: true, InUpdateResponse: true, } // ReadOnlyOnceAttributeMode is the mode of read-only-once attributes, which are returned only by create operations. // Attributes with this mode should also have the UseStateForUnknown plan modifier. ReadOnlyOnceAttributeMode = AttributeMode{ InCreateResponse: true, } // WriteOnlyAttributeMode is the mode of write-only attributes, which are sent in every create and update operation, and never in any response. // Attribute with this mode should also have the UseStateForUnknown plan modifier. WriteOnlyAttributeMode = AttributeMode{ InCreateRequest: true, InUpdateRequest: true, } // WriteOnlyOnceAttributeMode is the mode of write-only-once attributes, which are sent in only in create operations. // Attribute with this mode should also have the UseStateForUnknown plan modifier. WriteOnlyOnceAttributeMode = AttributeMode{ InCreateRequest: true, } )
var IPAddress = types.ObjectType{ AttrTypes: map[string]attr.Type{ "exclusion": types.BoolType, "ip_address": types.StringType, }, }
var IPRange = types.ObjectType{ AttrTypes: map[string]attr.Type{ "exclusion": types.BoolType, "from_ip_address": types.StringType, "to_ip_address": types.StringType, }, }
var Label = types.ObjectType{ AttrTypes: map[string]attr.Type{ "key": types.StringType, "value": types.StringType, }, }
var PortRange = types.ObjectType{ AttrTypes: map[string]attr.Type{ "from_port": types.Int64Type, "to_port": types.Int64Type, "protocol": types.StringType, }, }
var SupportedIconTypes = []string{}/* 339 elements not displayed */
var TagType = types.ObjectType{ AttrTypes: map[string]attr.Type{ "key": types.StringType, "value": types.StringType, }, }
Functions ¶
func AttributeIsOptional ¶
AttributeIsOptional returns whether an attribute should be optional in gRPC messages, i.e., whether it is optional with no default value.
func ProtoMessageName ¶
ProtoMessageName converts a Terraform resource, data source, or field name (in snake_case) into a ProtocolBuffer message name (in UpperCamelCase).
func ProtoMessageNameForCreateRequest ¶
ProtoMessageNameForCreateRequest returns the name of the Protocol Buffer message for create requests for the given CamelCased resource name.
func ProtoMessageNameForCreateResponse ¶
ProtoMessageNameForCreateResponse returns the name of the Protocol Buffer message for create responses for the given CamelCased resource name.
func ProtoMessageNameForDeleteRequest ¶
ProtoMessageNameForDeleteRequest returns the name of the Protocol Buffer message for delete requests for the given CamelCased resource name.
func ProtoMessageNameForReadRequest ¶
ProtoMessageNameForReadRequest returns the name of the Protocol Buffer message for read requests for the given CamelCased resource name.
func ProtoMessageNameForReadResponse ¶
ProtoMessageNameForReadResponse returns the name of the Protocol Buffer message for read responses for the given CamelCased resource name.
func ProtoMessageNameForUpdateRequest ¶
ProtoMessageNameForUpdateRequest returns the name of the Protocol Buffer message for update requests for the given CamelCased resource name.
func ProtoMessageNameForUpdateResponse ¶
ProtoMessageNameForUpdateResponse returns the name of the Protocol Buffer message for update responses for the given CamelCased resource name.
func RPCNameForCreate ¶
RPCNameForCreate returns the name of the gRPC RPC used to create resources with the given CamelCased resource name.
func RPCNameForDelete ¶
RPCNameForDelete returns the name of the gRPC RPC used to delete resources with the given CamelCased resource name.
func RPCNameForRead ¶
RPCNameForRead returns the name of the gRPC RPC used to read resources with the given CamelCased resource name.
func RPCNameForUpdate ¶
RPCNameForUpdate returns the name of the gRPC RPC used to update resources with the given CamelCased resource name.
func SortDataSourceAttributes ¶
func SortDataSourceAttributes(attrs map[string]datasource_schema.Attribute) []string
SortDataSourceAttributes returns the sorted names of a set of data source attributes.
func SortObjectAttributes ¶ added in v1.3.0
func SortResourceAttributes ¶
func SortResourceAttributes(attrs map[string]resource_schema.Attribute) []string
SortResourceAttributes returns the sorted names of a set of resource attributes.
Types ¶
type AttributeMode ¶
type AttributeMode struct {
// InCreateRequest is true if the attribute should be included in create RPC request messages.
InCreateRequest bool
// InCreateResponse is true if the attribute should be included in create RPC response messages.
InCreateResponse bool
// InReadRequest is true if the attribute should be included in read RPC request messages.
InReadRequest bool
// InCreateRequest is true if the attribute should be included in read RPC response messages.
InReadResponse bool
// InUpdateRequest is true if the attribute should be included in update RPC request messages.
InUpdateRequest bool
// InUpdateResponse is true if the attribute should be included in update RPC response messages.
InUpdateResponse bool
// InDeleteRequest is true if the attribute should be included in delete RPC request messages.
InDeleteRequest bool
}
AttributeMode is the mode of a resource attribute, as the set of RPC messages it should be included in.
func GetResourceAttributeMode ¶
func GetResourceAttributeMode(attrSchema resource_schema.Attribute) AttributeMode
GetResourceAttributeMode returns the mode for a resource attribute.
type AttributeWithMode ¶
type AttributeWithMode interface {
// GetMode() returns the mode of the attribute.
GetMode() AttributeMode
}
AttributeWithMode provides the mode of an attribute.
type BoolResourceAttributeWithMode ¶
type BoolResourceAttributeWithMode struct {
resource_schema.BoolAttribute
// contains filtered or unexported fields
}
BoolResourceAttributeWithMode is a BoolAttribute with an explicit attribute mode.
func (BoolResourceAttributeWithMode) GetMode ¶
func (a BoolResourceAttributeWithMode) GetMode() AttributeMode
type DataSource ¶
type DataSource struct {
// TypeName is the name of this data source type.
TypeName string
// Schema is the schema of this data source type.
Schema datasource_schema.Schema
}
DataSource is the complete definition of a data source type.
type DataSources ¶
type DataSources []DataSource
DataSources is a list of DataSources elements. The TypeName of each DataSources must be unique.
func (DataSources) Len ¶
func (r DataSources) Len() int
func (DataSources) Less ¶
func (r DataSources) Less(i, j int) bool
func (DataSources) Swap ¶
func (r DataSources) Swap(i, j int)
type Float32ResourceAttributeWithMode ¶
type Float32ResourceAttributeWithMode struct {
resource_schema.Float32Attribute
// contains filtered or unexported fields
}
Float32ResourceAttributeWithMode is a Float32Attribute with an explicit attribute mode.
func (Float32ResourceAttributeWithMode) GetMode ¶
func (a Float32ResourceAttributeWithMode) GetMode() AttributeMode
type Float64ResourceAttributeWithMode ¶
type Float64ResourceAttributeWithMode struct {
resource_schema.Float64Attribute
// contains filtered or unexported fields
}
Float64ResourceAttributeWithMode is a Float64Attribute with an explicit attribute mode.
func (Float64ResourceAttributeWithMode) GetMode ¶
func (a Float64ResourceAttributeWithMode) GetMode() AttributeMode
type Int32ResourceAttributeWithMode ¶
type Int32ResourceAttributeWithMode struct {
resource_schema.Int32Attribute
// contains filtered or unexported fields
}
Int32ResourceAttributeWithMode is a Int32Attribute with an explicit attribute mode.
func (Int32ResourceAttributeWithMode) GetMode ¶
func (a Int32ResourceAttributeWithMode) GetMode() AttributeMode
type Int64ResourceAttributeWithMode ¶
type Int64ResourceAttributeWithMode struct {
resource_schema.Int64Attribute
// contains filtered or unexported fields
}
Int64ResourceAttributeWithMode is a Int64Attribute with an explicit attribute mode.
func (Int64ResourceAttributeWithMode) GetMode ¶
func (a Int64ResourceAttributeWithMode) GetMode() AttributeMode
type ListNestedResourceAttributeWithMode ¶ added in v1.8.0
type ListNestedResourceAttributeWithMode struct {
resource_schema.ListNestedAttribute
// contains filtered or unexported fields
}
ListNestedResourceAttributeWithMode is a ListNestedAttribute with an explicit attribute mode.
func (ListNestedResourceAttributeWithMode) GetMode ¶ added in v1.8.0
func (a ListNestedResourceAttributeWithMode) GetMode() AttributeMode
type ListResourceAttributeWithMode ¶
type ListResourceAttributeWithMode struct {
resource_schema.ListAttribute
// contains filtered or unexported fields
}
ListResourceAttributeWithMode is a ListAttribute with an explicit attribute mode.
func (ListResourceAttributeWithMode) GetMode ¶
func (a ListResourceAttributeWithMode) GetMode() AttributeMode
type MapResourceAttributeWithMode ¶
type MapResourceAttributeWithMode struct {
resource_schema.MapAttribute
// contains filtered or unexported fields
}
MapResourceAttributeWithMode is a MapAttribute with an explicit attribute mode.
func (MapResourceAttributeWithMode) GetMode ¶
func (a MapResourceAttributeWithMode) GetMode() AttributeMode
type NumberResourceAttributeWithMode ¶
type NumberResourceAttributeWithMode struct {
resource_schema.NumberAttribute
// contains filtered or unexported fields
}
NumberResourceAttributeWithMode is a NumberAttribute with an explicit attribute mode.
func (NumberResourceAttributeWithMode) GetMode ¶
func (a NumberResourceAttributeWithMode) GetMode() AttributeMode
type ObjectResourceAttributeWithMode ¶
type ObjectResourceAttributeWithMode struct {
resource_schema.ObjectAttribute
// contains filtered or unexported fields
}
ObjectResourceAttributeWithMode is a ObjectAttribute with an explicit attribute mode.
func (ObjectResourceAttributeWithMode) GetMode ¶
func (a ObjectResourceAttributeWithMode) GetMode() AttributeMode
type Resource ¶
type Resource struct {
// TypeName is the name of this resource type.
TypeName string
// Schema is the schema of this resource type.
Schema resource_schema.Schema
}
Resource is the complete definition of a resource type.
type Resources ¶
type Resources []Resource
Resources is a list of Resource elements. The TypeName of each Resource must be unique.
type Schema ¶
type Schema interface {
// Version returns the version of this schema: "v1", "v2", etc.
// The version must be incremented whenever the schema is modified in a backward-incompatible manner, i.e. when
// a resource, datasource, or attribute is deleted,
// an optional attribute is modified to be required,
// when a required attribute is added to an existing resource,
// or when the type of an existing attribute is modified.
Version() string
// Resources returns the list of resources provided by the provider sorted by TypeName.
Resources() Resources
// DataSources returns the list of data sources provided by the provider sorted by TypeName.
DataSources() DataSources
}
Schema contains the definitions of all the resources and data sources provided by a provider.
func CloudSecure ¶
func CloudSecure() Schema
CloudSecure returns the schemas of CloudSecure resources and data sources.
type SetResourceAttributeWithMode ¶
type SetResourceAttributeWithMode struct {
resource_schema.SetAttribute
// contains filtered or unexported fields
}
SetResourceAttributeWithMode is a SetAttribute with an explicit attribute mode.
func (SetResourceAttributeWithMode) GetMode ¶
func (a SetResourceAttributeWithMode) GetMode() AttributeMode
type StringResourceAttributeWithMode ¶
type StringResourceAttributeWithMode struct {
resource_schema.StringAttribute
// contains filtered or unexported fields
}
StringResourceAttributeWithMode is a StringAttribute with an explicit attribute mode.
func (StringResourceAttributeWithMode) GetMode ¶
func (a StringResourceAttributeWithMode) GetMode() AttributeMode
Source Files
¶
- api.go
- application_aws_resources_resource.go
- application_azure_resources_resource.go
- application_policy_rule_resource.go
- application_resource.go
- attributemode.go
- aws_account_resource.go
- aws_flow_logs_s3_bucket_resource.go
- azure_flow_logs_storage_account_resource.go
- azure_subscription_resource.go
- deployment_resource.go
- doc.go
- gcp_flow_logs_pubsub_topic_resource.go
- gcp_project_resource.go
- id.go
- ip_list_resource.go
- k8s_cluster_onboarding_credential_resource.go
- k8s_cluster_resource.go
- names.go
- optional.go
- organization_policy_resource.go
- organization_policy_rule_resource.go
- schema.go
- tag_to_label_resource.go