Documentation
¶
Index ¶
Constants ¶
const ( DataSourceType = "DataSourceType" ResourceType = "ResourceType" DirPerm = 0755 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Emitter ¶
func (Emitter) EmitResourceSchemaRequiredAttributesValidator ¶
func (e Emitter) EmitResourceSchemaRequiredAttributesValidator()
EmitResourceSchemaRequiredAttributesValidator generates any resource schema-level required Attributes validators.
func (Emitter) EmitRootPropertiesSchema ¶
func (e Emitter) EmitRootPropertiesSchema(attributeNameMap map[string]string, computedOnly bool) (Features, error)
EmitRootPropertiesSchema generates the Terraform Plugin SDK code for a CloudFormation root schema and emits the generated code to the emitter's Writer. Code features are returned. The root schema is the map of root property names to Attributes. To generate all code features as "Computed", e.g. to be used in a singular data source, set the computedOnly argument to true.
type Features ¶
type Features int
Features of the emitted code.
const ( HasUpdatableProperty Features = 1 << iota // At least one property can be updated. UsesInternalTypes // Uses a type from the internal/types package. HasRequiredRootProperty // At least one root property is required. UsesValidation // Uses a type from the internal/validate package. HasIDRootProperty // Has a root property named "id" )
type PluralDataSourceGenerator ¶
type PluralDataSourceGenerator struct {
Generator
// contains filtered or unexported fields
}
func NewPluralDataSourceGenerator ¶
func NewPluralDataSourceGenerator(ui cli.Ui, acceptanceTestsTemplateBody, schemaTemplateBody, cfType, tfDataSourceType string) *PluralDataSourceGenerator
func (*PluralDataSourceGenerator) Generate ¶
func (p *PluralDataSourceGenerator) Generate(packageName, schemaFilename, acctestsFilename string) error
Generate generates the plural data source type's factory into the specified file.
type Resource ¶
func NewResource ¶
NewResource creates a Resource type from the corresponding resource's CloudFormation Schema file
type ResourceGenerator ¶
type ResourceGenerator struct {
Generator
// contains filtered or unexported fields
}
func NewResourceGenerator ¶
func NewResourceGenerator(ui cli.Ui, acceptanceTestsTemplateBody, schemaTemplateBody, cfTypeSchemaFile, tfResourceType string) *ResourceGenerator
func (*ResourceGenerator) Generate ¶
func (r *ResourceGenerator) Generate(packageName, schemaFilename, acctestsFilename string) error
Generate generates the resource's type factory into the specified file.
type TemplateData ¶
type TemplateData struct {
AcceptanceTestFunctionPrefix string
AttributeNameMap map[string]string
CloudFormationTypeName string
CreateTimeoutInMinutes int
DeleteTimeoutInMinutes int
FactoryFunctionName string
HasRequiredAttribute bool
HasUpdateMethod bool
ImportInternalTypes bool
ImportValidate bool
PackageName string
RequiredAttributesValidator string
RootPropertiesSchema string
SchemaDescription string
SchemaVersion int64
SyntheticIDAttribute bool
TerraformTypeName string
UpdateTimeoutInMinutes int
WriteOnlyPropertyPaths []string
}