當前位置: 首頁>>代碼示例>>Golang>>正文


Golang schema.EnvDefaultFunc函數代碼示例

本文整理匯總了Golang中github.com/hashicorp/terraform/helper/schema.EnvDefaultFunc函數的典型用法代碼示例。如果您正苦於以下問題:Golang EnvDefaultFunc函數的具體用法?Golang EnvDefaultFunc怎麽用?Golang EnvDefaultFunc使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了EnvDefaultFunc函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: Provider

// Provider returns a terraform.ResourceProvider.
func Provider() terraform.ResourceProvider {
	return &schema.Provider{
		Schema: map[string]*schema.Schema{
			"email": &schema.Schema{
				Type:        schema.TypeString,
				Required:    true,
				DefaultFunc: schema.EnvDefaultFunc("NSOT_EMAIL", nil),
				Description: "Your nsot email.",
			},

			"secret": &schema.Schema{
				Type:        schema.TypeString,
				Required:    true,
				DefaultFunc: schema.EnvDefaultFunc("NSOT_SECRET", nil),
				Description: "The secret key for API operations.",
			},

			"url": &schema.Schema{
				Type:        schema.TypeString,
				Required:    true,
				DefaultFunc: schema.EnvDefaultFunc("NSOT_URL", nil),
				Description: "The URL to your nsot instance.",
			},
		},

		ResourcesMap: map[string]*schema.Resource{
			"nsot_site": resourceNsotSite(),
		},

		ConfigureFunc: providerConfigure,
	}
}
開發者ID:sarguru,項目名稱:terraform-provider-nsot,代碼行數:33,代碼來源:provider.go

示例2: Provider

// Provider returns a terraform.ResourceProvider.
func Provider() terraform.ResourceProvider {
	return &schema.Provider{
		ResourcesMap: map[string]*schema.Resource{
			"influxdb_database":         resourceDatabase(),
			"influxdb_user":             resourceUser(),
			"influxdb_continuous_query": resourceContinuousQuery(),
		},

		Schema: map[string]*schema.Schema{
			"url": &schema.Schema{
				Type:     schema.TypeString,
				Optional: true,
				DefaultFunc: schema.EnvDefaultFunc(
					"INFLUXDB_URL", "http://localhost:8086/",
				),
			},
			"username": &schema.Schema{
				Type:        schema.TypeString,
				Optional:    true,
				DefaultFunc: schema.EnvDefaultFunc("INFLUXDB_USERNAME", ""),
			},
			"password": &schema.Schema{
				Type:        schema.TypeString,
				Optional:    true,
				DefaultFunc: schema.EnvDefaultFunc("INFLUXDB_PASSWORD", ""),
			},
		},

		ConfigureFunc: configure,
	}
}
開發者ID:Originate,項目名稱:terraform,代碼行數:32,代碼來源:provider.go

示例3: Provider

func Provider() terraform.ResourceProvider {
	return &schema.Provider{
		Schema: map[string]*schema.Schema{
			"address": &schema.Schema{
				Type:        schema.TypeString,
				Required:    true,
				DefaultFunc: schema.EnvDefaultFunc("NOMAD_ADDR", nil),
				Description: "URL of the root of the target Nomad agent.",
			},

			"region": &schema.Schema{
				Type:        schema.TypeString,
				Optional:    true,
				DefaultFunc: schema.EnvDefaultFunc("NOMAD_REGION", ""),
				Description: "Region of the target Nomad agent.",
			},
		},

		ConfigureFunc: providerConfigure,

		ResourcesMap: map[string]*schema.Resource{
			"nomad_job": resourceJob(),
		},
	}
}
開發者ID:paultyng,項目名稱:terraform,代碼行數:25,代碼來源:provider.go

示例4: Provider

// Provider returns a terraform.ResourceProvider.
func Provider() terraform.ResourceProvider {
	return &schema.Provider{
		Schema: map[string]*schema.Schema{
			"token": &schema.Schema{
				Type:        schema.TypeString,
				Required:    true,
				DefaultFunc: schema.EnvDefaultFunc("ATLAS_TOKEN", nil),
				Description: descriptions["token"],
			},

			"address": &schema.Schema{
				Type:        schema.TypeString,
				Optional:    true,
				DefaultFunc: schema.EnvDefaultFunc("ATLAS_ADDRESS", defaultAtlasServer),
				Description: descriptions["address"],
			},
		},

		ResourcesMap: map[string]*schema.Resource{
			"atlas_artifact": resourceArtifact(),
		},

		ConfigureFunc: providerConfigure,
	}
}
開發者ID:AssertSelenium,項目名稱:terraform,代碼行數:26,代碼來源:provider.go

示例5: Provider

// Provider returns a terraform.ResourceProvider.
func Provider() terraform.ResourceProvider {
	return &schema.Provider{
		Schema: map[string]*schema.Schema{
			"username": &schema.Schema{
				Type:        schema.TypeString,
				Required:    true,
				DefaultFunc: schema.EnvDefaultFunc("ULTRADNS_USERNAME", nil),
				Description: "UltraDNS Username.",
			},

			"password": &schema.Schema{
				Type:        schema.TypeString,
				Required:    true,
				DefaultFunc: schema.EnvDefaultFunc("ULTRADNS_PASSWORD", nil),
				Description: "UltraDNS User Password",
			},
			"baseurl": &schema.Schema{
				Type:        schema.TypeString,
				Required:    true,
				DefaultFunc: schema.EnvDefaultFunc("ULTRADNS_BASEURL", nil),
				Description: "UltraDNS Base Url(defaults to testing)",
			},
		},

		ResourcesMap: map[string]*schema.Resource{
			"ultradns_record": resourceUltraDNSRecord(),
		},

		ConfigureFunc: providerConfigure,
	}
}
開發者ID:RezaDKhan,項目名稱:terraform,代碼行數:32,代碼來源:provider.go

示例6: Provider

// Provider returns a terraform.ResourceProvider.
func Provider() terraform.ResourceProvider {
	return &schema.Provider{
		Schema: map[string]*schema.Schema{
			"credentials": &schema.Schema{
				Type:         schema.TypeString,
				Optional:     true,
				DefaultFunc:  schema.EnvDefaultFunc("GOOGLE_CREDENTIALS", nil),
				ValidateFunc: validateCredentials,
			},

			"project": &schema.Schema{
				Type:        schema.TypeString,
				Required:    true,
				DefaultFunc: schema.EnvDefaultFunc("GOOGLE_PROJECT", nil),
			},

			"region": &schema.Schema{
				Type:        schema.TypeString,
				Required:    true,
				DefaultFunc: schema.EnvDefaultFunc("GOOGLE_REGION", nil),
			},
		},

		ResourcesMap: map[string]*schema.Resource{
			"googleappengine_app": resourceAppengine(),
		},

		ConfigureFunc: providerConfigure,
	}
}
開發者ID:22Acacia,項目名稱:terraform-provider-googleappengine,代碼行數:31,代碼來源:provider.go

示例7: Provider

// Provider returns a terraform.ResourceProvider.
func Provider() terraform.ResourceProvider {

	// The actual provider
	return &schema.Provider{
		Schema: map[string]*schema.Schema{
			"token": &schema.Schema{
				Type:        schema.TypeString,
				Required:    true,
				DefaultFunc: schema.EnvDefaultFunc("GITHUB_TOKEN", nil),
				Description: descriptions["token"],
			},
			"organization": &schema.Schema{
				Type:        schema.TypeString,
				Required:    true,
				DefaultFunc: schema.EnvDefaultFunc("GITHUB_ORGANIZATION", nil),
				Description: descriptions["organization"],
			},
		},

		ResourcesMap: map[string]*schema.Resource{
			"github_team":            resourceGithubTeam(),
			"github_team_membership": resourceGithubTeamMembership(),
			"github_team_repository": resourceGithubTeamRepository(),
			"github_membership":      resourceGithubMembership(),
		},

		ConfigureFunc: providerConfigure,
	}
}
開發者ID:discogestalt,項目名稱:terraform,代碼行數:30,代碼來源:provider.go

示例8: Provider

func Provider() *schema.Provider {
	return &schema.Provider{
		Schema: map[string]*schema.Schema{
			"username": &schema.Schema{
				Type:        schema.TypeString,
				Optional:    true,
				DefaultFunc: schema.EnvDefaultFunc("CONOHA_USERNAME", nil),
			},
			"password": &schema.Schema{
				Type:        schema.TypeString,
				Optional:    true,
				DefaultFunc: schema.EnvDefaultFunc("CONOHA_PASSWORD", nil),
			},
			"tenant_name": &schema.Schema{
				Type:        schema.TypeString,
				Optional:    true,
				DefaultFunc: schema.EnvDefaultFunc("CONOHA_TENANT_NAME", nil),
			},
			"region": &schema.Schema{
				Type:        schema.TypeString,
				Optional:    true,
				DefaultFunc: schema.EnvDefaultFunc("CONOHA_REGION", nil),
			},
		},
		ResourcesMap: map[string]*schema.Resource{
			"conoha_compute_keypair": resourceComputeKeypair(),
			"conoha_dns_domain":      resourceDnsDomain(),
		},
		ConfigureFunc: configure,
	}
}
開發者ID:hanazuki,項目名稱:terraform-provider-conoha,代碼行數:31,代碼來源:provider.go

示例9: Provider

// Provider returns a terraform.ResourceProvider.
func Provider() terraform.ResourceProvider {
	return &schema.Provider{
		Schema: map[string]*schema.Schema{
			"credentials": &schema.Schema{
				Type:        schema.TypeString,
				Required:    true,
				DefaultFunc: schema.EnvDefaultFunc("GOOGLE_CREDENTIALS", nil),
			},

			"project": &schema.Schema{
				Type:        schema.TypeString,
				Required:    true,
				DefaultFunc: schema.EnvDefaultFunc("GOOGLE_PROJECT", nil),
			},

			"region": &schema.Schema{
				Type:        schema.TypeString,
				Required:    true,
				DefaultFunc: schema.EnvDefaultFunc("GOOGLE_REGION", nil),
			},

			"CredentialsFile": &schema.Schema{
				Type:     schema.TypeString,
				Computed: true,
			},
		},

		ResourcesMap: map[string]*schema.Resource{
			"googlecli_dataflow":                     resourceDataflow(),
			"googlecli_container_replica_controller": resourceContainerReplicaController(),
		},

		ConfigureFunc: providerConfigure,
	}
}
開發者ID:holidayextras,項目名稱:terraform-provider-googlecli,代碼行數:36,代碼來源:provider.go

示例10: Provider

func Provider() terraform.ResourceProvider {

	return &schema.Provider{
		Schema: map[string]*schema.Schema{
			"target": &schema.Schema{
				Type:        schema.TypeString,
				Required:    true,
				DefaultFunc: schema.EnvDefaultFunc("BOSH_TARGET", nil),
			},
			"user": &schema.Schema{
				Type:        schema.TypeString,
				Required:    true,
				DefaultFunc: schema.EnvDefaultFunc("BOSH_USER", nil),
			},
			"password": &schema.Schema{
				Type:        schema.TypeString,
				Required:    true,
				DefaultFunc: schema.EnvDefaultFunc("BOSH_PASSWORD", nil),
			},
		},
		ResourcesMap: map[string]*schema.Resource{
			"bosh_stemcell":    resourceBoshStemcell(),
			"bosh_release":     resourceBoshRelease(),
			"bosh_cloudconfig": resourceBoshCloudConfig(),
			"bosh_deployment":  resourceBoshDeployment(),
			"bosh_microbosh":   resourceBoshMicrobosh(),
		},
		ConfigureFunc: providerConfigure,
	}
}
開發者ID:malston,項目名稱:terraform-provider-bosh,代碼行數:30,代碼來源:provider.go

示例11: Provider

// Provider returns a terraform.ResourceProvider.
func Provider() terraform.ResourceProvider {
	return &schema.Provider{
		Schema: map[string]*schema.Schema{
			"api_key": &schema.Schema{
				Type:        schema.TypeString,
				Required:    true,
				DefaultFunc: schema.EnvDefaultFunc("DATADOG_API_KEY", nil), // TODO: not fetched from env?
			},
			"app_key": &schema.Schema{
				Type:        schema.TypeString,
				Required:    true,
				DefaultFunc: schema.EnvDefaultFunc("DATADOG_APP_KEY", nil),
			},
		},

		ResourcesMap: map[string]*schema.Resource{
			// TODO this is where the other resources will be mapped
			"datadog_dashboard":     resourceDatadogDashboard(),
			"datadog_graph":         resourceDatadogGraph(),
			"datadog_monitor":       resourceDatadogMonitor(),
			"datadog_service_check": resourceDatadogServiceCheck(),
			"datadog_metric_alert":  resourceDatadogMetricAlert(),
			"datadog_outlier_alert": resourceDatadogOutlierAlert(),
		},

		ConfigureFunc: providerConfigure,
	}
}
開發者ID:rgulewich,項目名稱:terraform-provider-datadog,代碼行數:29,代碼來源:provider.go

示例12: Provider

func Provider() terraform.ResourceProvider {
	return &schema.Provider{
		ResourcesMap: map[string]*schema.Resource{
			"beanstalk_hipchat_integration":             resourceHipchatIntegration(),
			"beanstalk_jira_integration":                resourceJiraIntegration(),
			"beanstalk_modular_webhook_integration":     resourceModularWebhookIntegration(),
			"beanstalk_repository":                      resourceRepository(),
			"beanstalk_repository_code_review_settings": resourceRepositoryCodeReviewSettings(),
			"beanstalk_user":                            resourceUser(),
			"beanstalk_team":                            resourceTeam(),
		},

		Schema: map[string]*schema.Schema{
			"account_name": &schema.Schema{
				Type:     schema.TypeString,
				Required: true,
			},
			"username": &schema.Schema{
				Type:        schema.TypeString,
				Required:    true,
				DefaultFunc: schema.EnvDefaultFunc("BEANSTALK_USERNAME", nil),
			},
			"access_token": &schema.Schema{
				Type:        schema.TypeString,
				Required:    true,
				DefaultFunc: schema.EnvDefaultFunc("BEANSTALK_ACCESS_TOKEN", nil),
			},
		},

		ConfigureFunc: providerConfigure,
	}
}
開發者ID:saymedia,項目名稱:terraform-beanstalk,代碼行數:32,代碼來源:provider.go

示例13: Provider

func Provider() terraform.ResourceProvider {
	return &schema.Provider{
		Schema: map[string]*schema.Schema{
			"account": &schema.Schema{
				Type:        schema.TypeString,
				Required:    true,
				DefaultFunc: schema.EnvDefaultFunc("BIGV_ACCOUNT", nil),
				Description: "The bigv account name",
			},
			"user": &schema.Schema{
				Type:        schema.TypeString,
				Required:    true,
				DefaultFunc: schema.EnvDefaultFunc("BIGV_USER", nil),
				Description: "The bigv user name",
			},
			"password": &schema.Schema{
				Type:        schema.TypeString,
				Required:    true,
				DefaultFunc: schema.EnvDefaultFunc("BGIV_PASSWORD", nil),
				Description: "The bigv password",
			},
		},
		ResourcesMap: map[string]*schema.Resource{
			"bigv_vm": resourceBigvVM(),
		},
		ConfigureFunc: providerConfigure,
	}
}
開發者ID:thermeon,項目名稱:terraform-provider-bigv,代碼行數:28,代碼來源:provider.go

示例14: Provider

// Provider returns a terraform.ResourceProvider.
func Provider() terraform.ResourceProvider {
	return &schema.Provider{
		Schema: map[string]*schema.Schema{
			"account_file": &schema.Schema{
				Type:         schema.TypeString,
				Optional:     true,
				DefaultFunc:  schema.EnvDefaultFunc("GOOGLE_ACCOUNT_FILE", nil),
				ValidateFunc: validateAccountFile,
			},

			"project": &schema.Schema{
				Type:        schema.TypeString,
				Required:    true,
				DefaultFunc: schema.EnvDefaultFunc("GOOGLE_PROJECT", nil),
			},

			"region": &schema.Schema{
				Type:        schema.TypeString,
				Required:    true,
				DefaultFunc: schema.EnvDefaultFunc("GOOGLE_REGION", nil),
			},
		},

		ResourcesMap: map[string]*schema.Resource{
			"google_compute_autoscaler":             resourceComputeAutoscaler(),
			"google_compute_address":                resourceComputeAddress(),
			"google_compute_backend_service":        resourceComputeBackendService(),
			"google_compute_disk":                   resourceComputeDisk(),
			"google_compute_firewall":               resourceComputeFirewall(),
			"google_compute_forwarding_rule":        resourceComputeForwardingRule(),
			"google_compute_global_address":         resourceComputeGlobalAddress(),
			"google_compute_global_forwarding_rule": resourceComputeGlobalForwardingRule(),
			"google_compute_http_health_check":      resourceComputeHttpHealthCheck(),
			"google_compute_instance":               resourceComputeInstance(),
			"google_compute_instance_group_manager": resourceComputeInstanceGroupManager(),
			"google_compute_instance_template":      resourceComputeInstanceTemplate(),
			"google_compute_network":                resourceComputeNetwork(),
			"google_compute_project_metadata":       resourceComputeProjectMetadata(),
			"google_compute_route":                  resourceComputeRoute(),
			"google_compute_ssl_certificate":        resourceComputeSslCertificate(),
			"google_compute_target_http_proxy":      resourceComputeTargetHttpProxy(),
			"google_compute_target_https_proxy":     resourceComputeTargetHttpsProxy(),
			"google_compute_target_pool":            resourceComputeTargetPool(),
			"google_compute_url_map":                resourceComputeUrlMap(),
			"google_compute_vpn_gateway":            resourceComputeVpnGateway(),
			"google_compute_vpn_tunnel":             resourceComputeVpnTunnel(),
			"google_container_cluster":              resourceContainerCluster(),
			"google_dns_managed_zone":               resourceDnsManagedZone(),
			"google_dns_record_set":                 resourceDnsRecordSet(),
			"google_sql_database":                   resourceSqlDatabase(),
			"google_sql_database_instance":          resourceSqlDatabaseInstance(),
			"google_storage_bucket":                 resourceStorageBucket(),
			"google_storage_bucket_acl":             resourceStorageBucketAcl(),
			"google_storage_bucket_object":          resourceStorageBucketObject(),
			"google_storage_object_acl":             resourceStorageObjectAcl(),
		},

		ConfigureFunc: providerConfigure,
	}
}
開發者ID:ninglipeng,項目名稱:terraform,代碼行數:61,代碼來源:provider.go

示例15: Provider

// Provider returns a terraform.ResourceProvider.
func Provider() terraform.ResourceProvider {
	return &schema.Provider{
		Schema: map[string]*schema.Schema{
			"api_url": &schema.Schema{
				Type:        schema.TypeString,
				Required:    true,
				DefaultFunc: schema.EnvDefaultFunc("RANCHER_URL", nil),
				Description: descriptions["api_url"],
			},
			"access_key": &schema.Schema{
				Type:        schema.TypeString,
				Optional:    true,
				DefaultFunc: schema.EnvDefaultFunc("RANCHER_ACCESS_KEY", ""),
				Description: descriptions["access_key"],
			},
			"secret_key": &schema.Schema{
				Type:        schema.TypeString,
				Optional:    true,
				DefaultFunc: schema.EnvDefaultFunc("RANCHER_SECRET_KEY", ""),
				Description: descriptions["secret_key"],
			},
		},

		ResourcesMap: map[string]*schema.Resource{
			"rancher_environment":         resourceRancherEnvironment(),
			"rancher_registration_token":  resourceRancherRegistrationToken(),
			"rancher_registry":            resourceRancherRegistry(),
			"rancher_registry_credential": resourceRancherRegistryCredential(),
			"rancher_stack":               resourceRancherStack(),
		},

		ConfigureFunc: providerConfigure,
	}
}
開發者ID:hooklift,項目名稱:terraform,代碼行數:35,代碼來源:provider.go


注:本文中的github.com/hashicorp/terraform/helper/schema.EnvDefaultFunc函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。