Documentation
¶
Index ¶
- Constants
- Variables
- func CleanupProviderConfig(directory ...string)
- func CleanupTempFiles(tempConfigDir string)
- func ConfigureProvider(level string)
- func ExecPostExportSteps(tempConfigDir string, targetConfigDir string, targetResourceFileName string, ...)
- func ExecPreExportSteps(tempConfigDir string, level string)
- func FetchImportConfiguration(subaccountId string, directoryId string, organizationId string, spaceId string, ...) (map[string]interface{}, error)
- func FinalizeTfConfig(configFolder string)
- func GenerateConfig(resourceFileName string, configFolder string, isMainCmd bool, ...) error
- func GetExecutionLevelAndId(subaccountID string, directoryID string, organizationID string, spaceID string) (level string, id string)
- func GetResourcesList(resourcesString string, level string) []string
- func GetValidResourcesByLevel(level string) []string
- func SetupConfigDir(configFolder string, isMainCmd bool, level string)
- func TranslateResourceParamToTechnicalName(resource string, level string) string
- type BtpResource
- type BtpResources
- type DocKind
- type EntityDocs
- type ResourceMode
- type State
- type StateModule
- type StateResource
- type StateValues
Constants ¶
View Source
const ( SubaccountLevel = "subaccountLevel" DirectoryLevel = "directoryLevel" OrganizationLevel = "organizationLevel" SpaceLevel = "spaceLevel" )
View Source
const ( CmdDirectoryParameter string = "directory" CmdSubaccountParameter string = "subaccount" CmdEntitlementParameter string = "entitlements" CmdEnvironmentInstanceParameter string = "environment-instances" CmdSubscriptionParameter string = "subscriptions" CmdTrustConfigurationParameter string = "trust-configurations" CmdRoleParameter string = "roles" CmdRoleCollectionParameter string = "role-collections" CmdServiceInstanceParameter string = "service-instances" CmdServiceBindingParameter string = "service-bindings" CmdSecuritySettingParameter string = "security-settings" CmdCfSpaceParameter string = "spaces" CmdCfUserParameter string = "users" CmdCfDomainParamater string = "domains" CmdCfOrgRoleParameter string = "org-roles" CmdCfRouteParameter string = "routes" CmdCfSpaceQuotaParameter string = "space-quotas" CmdCfServiceInstanceParameter string = "cf-service-instances" CmdCfSpaceRoleParameter string = "space-roles" )
View Source
const ( SubaccountType string = "btp_subaccount" SubaccountEntitlementType string = "btp_subaccount_entitlement" SubaccountEnvironmentInstanceType string = "btp_subaccount_environment_instance" SubaccountSubscriptionType string = "btp_subaccount_subscription" SubaccountTrustConfigurationType string = "btp_subaccount_trust_configuration" SubaccountRoleType string = "btp_subaccount_role" SubaccountRoleCollectionType string = "btp_subaccount_role_collection" SubaccountServiceInstanceType string = "btp_subaccount_service_instance" SubaccountServiceBindingType string = "btp_subaccount_service_binding" SubaccountSecuritySettingType string = "btp_subaccount_security_setting" )
View Source
const ( DirectoryType string = "btp_directory" DirectoryEntitlementType string = "btp_directory_entitlement" DirectoryRoleType string = "btp_directory_role" DirectoryRoleCollectionType string = "btp_directory_role_collection" )
View Source
const ( CfSpaceType string = "cloudfoundry_space" CfUserType string = "cloudfoundry_user" CfOrgRoleType string = "cloudfoundry_org_role" CfDomainType string = "cloudfoundry_domain" CfRouteType string = "cloudfoundry_route" CfSpaceQuotaType string = "cloudfoundry_space_quota" CfServiceInstanceType string = "cloudfoundry_service_instance" CfSpaceRoleType string = "cloudfoundry_space_role" )
View Source
const BtpProviderVersion = "v1.10.0"
Constants for TF version for Terraform providers
View Source
const CfProviderVersion = "v1.3.0"
View Source
const DirectoryFeatureDefault string = "DEFAULT"
View Source
const DirectoryFeatureEntitlements string = "ENTITLEMENTS"
View Source
const DirectoryFeatureRoles string = "AUTHORIZATIONS"
Variables ¶
View Source
var AllowedResourcesDirectory = []string{ CmdDirectoryParameter, CmdEntitlementParameter, CmdRoleParameter, CmdRoleCollectionParameter, }
View Source
var AllowedResourcesOrganization = []string{ CmdCfSpaceParameter, CmdCfUserParameter, CmdCfDomainParamater, CmdCfOrgRoleParameter, CmdCfRouteParameter, CmdCfSpaceQuotaParameter, CmdCfServiceInstanceParameter, CmdCfSpaceRoleParameter, }
View Source
var AllowedResourcesSubaccount = []string{ CmdSubaccountParameter, CmdEntitlementParameter, CmdEnvironmentInstanceParameter, CmdSubscriptionParameter, CmdTrustConfigurationParameter, CmdRoleParameter, CmdRoleCollectionParameter, CmdServiceBindingParameter, CmdServiceInstanceParameter, CmdSecuritySettingParameter, }
View Source
var TmpFolder string
Functions ¶
func CleanupProviderConfig ¶
func CleanupProviderConfig(directory ...string)
func CleanupTempFiles ¶
func CleanupTempFiles(tempConfigDir string)
func ConfigureProvider ¶
func ConfigureProvider(level string)
func ExecPostExportSteps ¶
func ExecPreExportSteps ¶
Convenience functions that wrap repetitive steps
func FinalizeTfConfig ¶
func FinalizeTfConfig(configFolder string)
func GenerateConfig ¶
func GetExecutionLevelAndId ¶
func GetResourcesList ¶
func SetupConfigDir ¶
Types ¶
type BtpResource ¶
type DocKind ¶
type DocKind string
DocKind indicates what kind of entity's documentation is being requested.
const DataSourcesKind DocKind = "data-sources"
const ResourcesKind DocKind = "resources"
type EntityDocs ¶
type EntityDocs struct { // Description is the description of the resource Description string Arguments map[string]*argumentDocs Attributes map[string]string Import string }
EntityDocs represents the documentation for a resource or datasource as extracted from TF markdown.
func GetDocByResourceName ¶
func GetDocByResourceName(kind DocKind, resourceName string, level string) (EntityDocs, error)
func GetDocsForResource ¶
func GetDocsForResource(org string, provider string, resourcePrefix string, kind DocKind, rawname string, providerModuleVersion string, githost string) (EntityDocs, error)
GetDocsForResource extracts documentation details for the given package from TF website documentation markdown content
type ResourceMode ¶
type ResourceMode string
type State ¶
type State struct { // The version of the state format. This should always match the // StateFormatVersion constant in this package, or else am // unmarshal will be unstable. FormatVersion string `json:"format_version,omitempty"` // The Terraform version used to make the state. TerraformVersion string `json:"terraform_version,omitempty"` // The values that make up the state. Values *StateValues `json:"values,omitempty"` }
type StateModule ¶
type StateModule struct { // All resources or data sources within this module. Resources []*StateResource `json:"resources,omitempty"` // The absolute module address, omitted for the root module. Address string `json:"address,omitempty"` // Any child modules within this module. ChildModules []*StateModule `json:"child_modules,omitempty"` }
type StateResource ¶
type StateResource struct { // The absolute resource address. Address string `json:"address,omitempty"` // The resource mode. Mode ResourceMode `json:"mode,omitempty"` // The resource type, example: "aws_instance" for aws_instance.foo. Type string `json:"type,omitempty"` // The resource name, example: "foo" for aws_instance.foo. Name string `json:"name,omitempty"` // The instance key for any resources that have been created using // "count" or "for_each". If neither of these apply the key will be // empty. // // This value can be either an integer (int) or a string. Index interface{} `json:"index,omitempty"` // The name of the provider this resource belongs to. This allows // the provider to be interpreted unambiguously in the unusual // situation where a provider offers a resource type whose name // does not start with its own name, such as the "googlebeta" // provider offering "google_compute_instance". ProviderName string `json:"provider_name,omitempty"` // The version of the resource type schema the "values" property // conforms to. SchemaVersion uint64 `json:"schema_version,"` // The JSON representation of the attribute values of the resource, // whose structure depends on the resource type schema. Any unknown // values are omitted or set to null, making them indistinguishable // from absent values. AttributeValues map[string]interface{} `json:"values,omitempty"` // The JSON representation of the sensitivity of the resource's // attribute values. Only attributes which are sensitive // are included in this structure. SensitiveValues json.RawMessage `json:"sensitive_values,omitempty"` // The addresses of the resources that this resource depends on. DependsOn []string `json:"depends_on,omitempty"` // If true, the resource has been marked as tainted and will be // re-created on the next update. Tainted bool `json:"tainted,omitempty"` // DeposedKey is set if the resource instance has been marked Deposed and // will be destroyed on the next apply. DeposedKey string `json:"deposed_key,omitempty"` }
type StateValues ¶
type StateValues struct { // The root module in this state representation. RootModule *StateModule `json:"root_module,omitempty"` }
Click to show internal directories.
Click to hide internal directories.