Documentation ¶
Index ¶
- Constants
- Variables
- func AddTags(client *ecs.Client, args *AddTagsArgs) error
- func GetNotFoundErrorFromString(str string) error
- func Provider() terraform.ResourceProvider
- func RemoveTags(client *ecs.Client, args *RemoveTagsArgs) error
- func String(v string) *string
- func TransformPeriod2Time(period int, chargeType string) (ut int, tt common.TimeType)
- func TransformTime2Period(ut int, tt common.TimeType) (period int)
- type AddTagsArgs
- type AliyunClient
- func (client *AliyunClient) ActiveScalingConfigurationById(sgId, configId string) error
- func (client *AliyunClient) AllocateDBPublicConnection(instanceId, port string) error
- func (client *AliyunClient) ConfigDBBackup(instanceId, backupTime, backupPeriod string, retentionPeriod int) error
- func (client *AliyunClient) CreateAccountByInfo(instanceId, username, pwd string) error
- func (client *AliyunClient) CreateDatabaseByInfo(instanceId, dbName, charset, desp string) error
- func (client *AliyunClient) DeleteScalingConfigurationById(sgId, configId string) error
- func (client *AliyunClient) DeleteScalingGroupById(sgId string) error
- func (client *AliyunClient) DeleteScalingRuleById(ruleId string) error
- func (client *AliyunClient) DeleteScheduleById(scheduleId string) error
- func (client *AliyunClient) DescribeDBInstanceById(id string) (instance *rds.DBInstanceAttribute, err error)
- func (client *AliyunClient) DescribeDBSecurityIps(instanceId string) (ips []rds.DBInstanceIPList, err error)
- func (client *AliyunClient) DescribeDatabaseByName(instanceId, dbName string) (ds []rds.Database, err error)
- func (client *AliyunClient) DescribeEipAddress(allocationId string) (*ecs.EipAddressSetType, error)
- func (client *AliyunClient) DescribeForwardEntry(forwardTableId string, forwardEntryId string) (ecs.ForwardTableEntrySetType, error)
- func (client *AliyunClient) DescribeImage(imageId string) (*ecs.ImageType, error)
- func (client *AliyunClient) DescribeLoadBalancerAttribute(slbId string) (*slb.LoadBalancerType, error)
- func (client *AliyunClient) DescribeMultiIZByRegion() (izs []string, err error)
- func (client *AliyunClient) DescribeNatGateway(natGatewayId string) (*ecs.NatGatewaySetType, error)
- func (client *AliyunClient) DescribeScalingConfigurationById(sgId, configId string) (*ess.ScalingConfigurationItemType, error)
- func (client *AliyunClient) DescribeScalingGroupById(sgId string) (*ess.ScalingGroupItemType, error)
- func (client *AliyunClient) DescribeScalingRuleById(sgId, ruleId string) (*ess.ScalingRuleItemType, error)
- func (client *AliyunClient) DescribeScheduleById(scheduleId string) (*ess.ScheduledTaskItemType, error)
- func (client *AliyunClient) DescribeSecurity(securityGroupId string) (*ecs.DescribeSecurityGroupAttributeResponse, error)
- func (client *AliyunClient) DescribeSecurityByAttr(securityGroupId, direction, nicType string) (*ecs.DescribeSecurityGroupAttributeResponse, error)
- func (client *AliyunClient) DescribeSecurityGroupRule(securityGroupId, direction, nicType, ipProtocol, portRange string) (*ecs.PermissionType, error)
- func (client *AliyunClient) DescribeSnatEntry(snatTableId string, snatEntryId string) (ecs.SnatEntrySetType, error)
- func (client *AliyunClient) DescribeVpc(vpcId string) (*ecs.VpcSetType, error)
- func (client *AliyunClient) DescribeZone(zoneID string) (*ecs.ZoneType, error)
- func (client *AliyunClient) DisableScalingConfigurationById(sgId string) error
- func (client *AliyunClient) DiskAvailable(zone *ecs.ZoneType, diskCategory ecs.DiskCategory) error
- func (client *AliyunClient) EnableScalingConfigurationById(sgId, configId string, ids []string) error
- func (client *AliyunClient) GetSecurityIps(instanceId string) ([]string, error)
- func (client *AliyunClient) GetVpcIdByVSwitchId(vswitchId string) (vpcId string, err error)
- func (client *AliyunClient) GrantDBPrivilege2Account(instanceId, username, dbName string) error
- func (client *AliyunClient) JoinSecurityGroups(instanceId string, securityGroupIds []string) error
- func (client *AliyunClient) LeaveSecurityGroups(instanceId string, securityGroupIds []string) error
- func (client *AliyunClient) ModifyDBClassStorage(instanceId, class, storage string) error
- func (client *AliyunClient) ModifyDBSecurityIps(instanceId, ips string) error
- func (client *AliyunClient) QueryInstanceSystemDisk(id string) (disk *ecs.DiskItemType, err error)
- func (client *AliyunClient) QueryInstancesById(id string) (instance *ecs.InstanceAttributesType, err error)
- func (client *AliyunClient) QueryInstancesByIds(ids []string) (instances []ecs.InstanceAttributesType, err error)
- func (client *AliyunClient) QueryRouteEntry(routeTableId, cidrBlock, nextHopType, nextHopId string) (rn *ecs.RouteEntrySetType, err error)
- func (client *AliyunClient) QueryRouteTableById(routeTableId string) (rt *ecs.RouteTableSetType, err error)
- func (client *AliyunClient) QueryRouteTables(args *ecs.DescribeRouteTablesArgs) (routeTables []ecs.RouteTableSetType, err error)
- func (client *AliyunClient) QueryVswitchById(vpcId, vswitchId string) (vsw *ecs.VSwitchSetType, err error)
- func (client *AliyunClient) QueryVswitches(args *ecs.DescribeVSwitchesArgs) (vswitches []ecs.VSwitchSetType, err error)
- func (client *AliyunClient) ResourceAvailable(zone *ecs.ZoneType, resourceType ecs.ResourceType) error
- func (client *AliyunClient) RevokeSecurityGroup(args *ecs.RevokeSecurityGroupArgs) error
- func (client *AliyunClient) RevokeSecurityGroupEgress(args *ecs.RevokeSecurityGroupEgressArgs) error
- type Config
- type GroupRuleDirection
- type GroupRuleIpProtocol
- type GroupRuleNicType
- type GroupRulePolicy
- type InstanceNetWork
- type Listener
- type ListenerErr
- type Protocol
- type RemoveTagsArgs
- type Tag
Constants ¶
View Source
const ( ClassicNet = InstanceNetWork("classic") VpcNet = InstanceNetWork("vpc") )
View Source
const ( Http = Protocol("http") Https = Protocol("https") Tcp = Protocol("tcp") Udp = Protocol("udp") )
Constants of protocol definition
View Source
const ( // common Notfound = "Not found" // ecs InstanceNotfound = "Instance.Notfound" // disk DiskIncorrectStatus = "IncorrectDiskStatus" DiskCreatingSnapshot = "DiskCreatingSnapshot" InstanceLockedForSecurity = "InstanceLockedForSecurity" SystemDiskNotFound = "SystemDiskNotFound" // eip EipIncorrectStatus = "IncorrectEipStatus" InstanceIncorrectStatus = "IncorrectInstanceStatus" HaVipIncorrectStatus = "IncorrectHaVipStatus" // slb LoadBalancerNotFound = "InvalidLoadBalancerId.NotFound" // security_group InvalidInstanceIdAlreadyExists = "InvalidInstanceId.AlreadyExists" InvalidSecurityGroupIdNotFound = "InvalidSecurityGroupId.NotFound" SgDependencyViolation = "DependencyViolation" //Nat gateway NatGatewayInvalidRegionId = "Invalid.RegionId" DependencyViolationBandwidthPackages = "DependencyViolation.BandwidthPackages" NotFindSnatEntryBySnatId = "NotFindSnatEntryBySnatId" NotFindForwardEntryByForwardId = "NotFindForwardEntryByForwardId" // vswitch VswitcInvalidRegionId = "InvalidRegionId.NotFound" // ess InvalidScalingGroupIdNotFound = "InvalidScalingGroupId.NotFound" IncorrectScalingConfigurationLifecycleState = "IncorrectScalingConfigurationLifecycleState" //unknown Error UnknownError = "UnknownError" )
View Source
const ( GroupRuleIngress = GroupRuleDirection("ingress") GroupRuleEgress = GroupRuleDirection("egress") )
View Source
const ( GroupRuleTcp = GroupRuleIpProtocol("tcp") GroupRuleUdp = GroupRuleIpProtocol("udp") GroupRuleIcmp = GroupRuleIpProtocol("icmp") GroupRuleGre = GroupRuleIpProtocol("gre") GroupRuleAll = GroupRuleIpProtocol("all") )
View Source
const ( GroupRuleInternet = GroupRuleNicType("internet") GroupRuleIntranet = GroupRuleNicType("intranet") )
View Source
const ( GroupRulePolicyAccept = GroupRulePolicy("accept") GroupRulePolicyDrop = GroupRulePolicy("drop") )
View Source
const ( EcsApiVersion20160314 = "2016-03-14" EcsApiVersion20140526 = "2014-05-26" )
View Source
const ( HealthCheckErrType = "healthCheckErrType" StickySessionErrType = "stickySessionErrType" CookieTimeOutErrType = "cookieTimeoutErrType" CookieErrType = "cookieErrType" )
View Source
const BusinessInfoKey = "Terraform"
View Source
const COLON_SEPARATED = ":"
View Source
const COMMA_SEPARATED = ","
View Source
const DB_DEFAULT_CONNECT_PORT = "3306"
default connect port of db
View Source
const DEFAULT_DB_SECURITY_IP = "127.0.0.1"
default security ip for db
View Source
const DEFAULT_INSTANCE_COUNT = 1
we the count of create instance is only one
View Source
const DEFAULT_REGION = "cn-beijing"
default region for all resource
View Source
const LOCAL_HOST_IP = "127.0.0.1"
View Source
const MULTI_IZ_SYMBOL = "MAZ"
symbol of multiIZ
Variables ¶
View Source
var DefaultBusinessInfo = ecs.BusinessInfo{
Pack: "terraform",
}
ValidProtocols network protocol list
Functions ¶
func GetNotFoundErrorFromString ¶ added in v0.9.4
func Provider ¶
func Provider() terraform.ResourceProvider
Provider returns a schema.Provider for alicloud
func RemoveTags ¶
func RemoveTags(client *ecs.Client, args *RemoveTagsArgs) error
func TransformPeriod2Time ¶ added in v0.9.2
turn period to TimeType
Types ¶
type AddTagsArgs ¶
type AliyunClient ¶
AliyunClient of aliyun
func (*AliyunClient) ActiveScalingConfigurationById ¶ added in v0.9.4
func (client *AliyunClient) ActiveScalingConfigurationById(sgId, configId string) error
func (*AliyunClient) AllocateDBPublicConnection ¶ added in v0.9.2
func (client *AliyunClient) AllocateDBPublicConnection(instanceId, port string) error
func (*AliyunClient) ConfigDBBackup ¶ added in v0.9.2
func (client *AliyunClient) ConfigDBBackup(instanceId, backupTime, backupPeriod string, retentionPeriod int) error
func (*AliyunClient) CreateAccountByInfo ¶ added in v0.9.2
func (client *AliyunClient) CreateAccountByInfo(instanceId, username, pwd string) error
func (*AliyunClient) CreateDatabaseByInfo ¶ added in v0.9.2
func (client *AliyunClient) CreateDatabaseByInfo(instanceId, dbName, charset, desp string) error
func (*AliyunClient) DeleteScalingConfigurationById ¶ added in v0.9.4
func (client *AliyunClient) DeleteScalingConfigurationById(sgId, configId string) error
func (*AliyunClient) DeleteScalingGroupById ¶ added in v0.9.4
func (client *AliyunClient) DeleteScalingGroupById(sgId string) error
func (*AliyunClient) DeleteScalingRuleById ¶ added in v0.9.4
func (client *AliyunClient) DeleteScalingRuleById(ruleId string) error
func (*AliyunClient) DeleteScheduleById ¶ added in v0.9.4
func (client *AliyunClient) DeleteScheduleById(scheduleId string) error
func (*AliyunClient) DescribeDBInstanceById ¶ added in v0.9.2
func (client *AliyunClient) DescribeDBInstanceById(id string) (instance *rds.DBInstanceAttribute, err error)
_______________ _______________ _______________ | | ______param______\ | | _____request_____\ | | | Business | | Service | | SDK/API | | | __________________ | | __________________ | | |______________| \ (obj, err) |______________| \ (status, cont) |______________| | | |A. {instance, nil} |a. {200, content} |B. {nil, error} |b. {200, nil} |c. {4xx, nil}
The API return 200 for resource not found. When getInstance is empty, then throw InstanceNotfound error. That the business layer only need to check error.
func (*AliyunClient) DescribeDBSecurityIps ¶ added in v0.9.2
func (client *AliyunClient) DescribeDBSecurityIps(instanceId string) (ips []rds.DBInstanceIPList, err error)
func (*AliyunClient) DescribeDatabaseByName ¶ added in v0.9.2
func (client *AliyunClient) DescribeDatabaseByName(instanceId, dbName string) (ds []rds.Database, err error)
func (*AliyunClient) DescribeEipAddress ¶
func (client *AliyunClient) DescribeEipAddress(allocationId string) (*ecs.EipAddressSetType, error)
func (*AliyunClient) DescribeForwardEntry ¶ added in v0.9.4
func (client *AliyunClient) DescribeForwardEntry(forwardTableId string, forwardEntryId string) (ecs.ForwardTableEntrySetType, error)
func (*AliyunClient) DescribeImage ¶
func (client *AliyunClient) DescribeImage(imageId string) (*ecs.ImageType, error)
func (*AliyunClient) DescribeLoadBalancerAttribute ¶
func (client *AliyunClient) DescribeLoadBalancerAttribute(slbId string) (*slb.LoadBalancerType, error)
func (*AliyunClient) DescribeMultiIZByRegion ¶ added in v0.9.2
func (client *AliyunClient) DescribeMultiIZByRegion() (izs []string, err error)
return multiIZ list of current region
func (*AliyunClient) DescribeNatGateway ¶
func (client *AliyunClient) DescribeNatGateway(natGatewayId string) (*ecs.NatGatewaySetType, error)
func (*AliyunClient) DescribeScalingConfigurationById ¶ added in v0.9.4
func (client *AliyunClient) DescribeScalingConfigurationById(sgId, configId string) (*ess.ScalingConfigurationItemType, error)
func (*AliyunClient) DescribeScalingGroupById ¶ added in v0.9.4
func (client *AliyunClient) DescribeScalingGroupById(sgId string) (*ess.ScalingGroupItemType, error)
func (*AliyunClient) DescribeScalingRuleById ¶ added in v0.9.4
func (client *AliyunClient) DescribeScalingRuleById(sgId, ruleId string) (*ess.ScalingRuleItemType, error)
func (*AliyunClient) DescribeScheduleById ¶ added in v0.9.4
func (client *AliyunClient) DescribeScheduleById(scheduleId string) (*ess.ScheduledTaskItemType, error)
func (*AliyunClient) DescribeSecurity ¶
func (client *AliyunClient) DescribeSecurity(securityGroupId string) (*ecs.DescribeSecurityGroupAttributeResponse, error)
func (*AliyunClient) DescribeSecurityByAttr ¶ added in v0.9.2
func (client *AliyunClient) DescribeSecurityByAttr(securityGroupId, direction, nicType string) (*ecs.DescribeSecurityGroupAttributeResponse, error)
func (*AliyunClient) DescribeSecurityGroupRule ¶
func (client *AliyunClient) DescribeSecurityGroupRule(securityGroupId, direction, nicType, ipProtocol, portRange string) (*ecs.PermissionType, error)
func (*AliyunClient) DescribeSnatEntry ¶ added in v0.9.4
func (client *AliyunClient) DescribeSnatEntry(snatTableId string, snatEntryId string) (ecs.SnatEntrySetType, error)
func (*AliyunClient) DescribeVpc ¶
func (client *AliyunClient) DescribeVpc(vpcId string) (*ecs.VpcSetType, error)
func (*AliyunClient) DescribeZone ¶
func (client *AliyunClient) DescribeZone(zoneID string) (*ecs.ZoneType, error)
DescribeZone validate zoneId is valid in region
func (*AliyunClient) DisableScalingConfigurationById ¶ added in v0.9.4
func (client *AliyunClient) DisableScalingConfigurationById(sgId string) error
func (*AliyunClient) DiskAvailable ¶
func (client *AliyunClient) DiskAvailable(zone *ecs.ZoneType, diskCategory ecs.DiskCategory) error
func (*AliyunClient) EnableScalingConfigurationById ¶ added in v0.9.4
func (client *AliyunClient) EnableScalingConfigurationById(sgId, configId string, ids []string) error
func (*AliyunClient) GetSecurityIps ¶ added in v0.9.2
func (client *AliyunClient) GetSecurityIps(instanceId string) ([]string, error)
func (*AliyunClient) GetVpcIdByVSwitchId ¶ added in v0.9.2
func (client *AliyunClient) GetVpcIdByVSwitchId(vswitchId string) (vpcId string, err error)
func (*AliyunClient) GrantDBPrivilege2Account ¶ added in v0.9.2
func (client *AliyunClient) GrantDBPrivilege2Account(instanceId, username, dbName string) error
func (*AliyunClient) JoinSecurityGroups ¶
func (client *AliyunClient) JoinSecurityGroups(instanceId string, securityGroupIds []string) error
todo: support syc
func (*AliyunClient) LeaveSecurityGroups ¶
func (client *AliyunClient) LeaveSecurityGroups(instanceId string, securityGroupIds []string) error
func (*AliyunClient) ModifyDBClassStorage ¶ added in v0.9.2
func (client *AliyunClient) ModifyDBClassStorage(instanceId, class, storage string) error
func (*AliyunClient) ModifyDBSecurityIps ¶ added in v0.9.2
func (client *AliyunClient) ModifyDBSecurityIps(instanceId, ips string) error
func (*AliyunClient) QueryInstanceSystemDisk ¶ added in v0.9.2
func (client *AliyunClient) QueryInstanceSystemDisk(id string) (disk *ecs.DiskItemType, err error)
func (*AliyunClient) QueryInstancesById ¶
func (client *AliyunClient) QueryInstancesById(id string) (instance *ecs.InstanceAttributesType, err error)
func (*AliyunClient) QueryInstancesByIds ¶
func (client *AliyunClient) QueryInstancesByIds(ids []string) (instances []ecs.InstanceAttributesType, err error)
func (*AliyunClient) QueryRouteEntry ¶
func (client *AliyunClient) QueryRouteEntry(routeTableId, cidrBlock, nextHopType, nextHopId string) (rn *ecs.RouteEntrySetType, err error)
func (*AliyunClient) QueryRouteTableById ¶
func (client *AliyunClient) QueryRouteTableById(routeTableId string) (rt *ecs.RouteTableSetType, err error)
func (*AliyunClient) QueryRouteTables ¶
func (client *AliyunClient) QueryRouteTables(args *ecs.DescribeRouteTablesArgs) (routeTables []ecs.RouteTableSetType, err error)
func (*AliyunClient) QueryVswitchById ¶
func (client *AliyunClient) QueryVswitchById(vpcId, vswitchId string) (vsw *ecs.VSwitchSetType, err error)
func (*AliyunClient) QueryVswitches ¶
func (client *AliyunClient) QueryVswitches(args *ecs.DescribeVSwitchesArgs) (vswitches []ecs.VSwitchSetType, err error)
describe vswitch by param filters
func (*AliyunClient) ResourceAvailable ¶
func (client *AliyunClient) ResourceAvailable(zone *ecs.ZoneType, resourceType ecs.ResourceType) error
ResourceAvailable check resource available for zone
func (*AliyunClient) RevokeSecurityGroup ¶
func (client *AliyunClient) RevokeSecurityGroup(args *ecs.RevokeSecurityGroupArgs) error
func (*AliyunClient) RevokeSecurityGroupEgress ¶ added in v0.9.2
func (client *AliyunClient) RevokeSecurityGroupEgress(args *ecs.RevokeSecurityGroupEgressArgs) error
type GroupRuleDirection ¶
type GroupRuleDirection string
type GroupRuleIpProtocol ¶
type GroupRuleIpProtocol string
type GroupRuleNicType ¶
type GroupRuleNicType string
type GroupRulePolicy ¶
type GroupRulePolicy string
type InstanceNetWork ¶
type InstanceNetWork string
type Listener ¶
type Listener struct { slb.HTTPListenerType InstancePort int LoadBalancerPort int Protocol string //tcp & udp PersistenceTimeout int //https SSLCertificateId string //tcp HealthCheckType slb.HealthCheckType //api interface: http & https is HealthCheckTimeout, tcp & udp is HealthCheckConnectTimeout HealthCheckConnectTimeout int }
type ListenerErr ¶ added in v0.9.2
func (*ListenerErr) Error ¶ added in v0.9.2
func (e *ListenerErr) Error() string
type RemoveTagsArgs ¶
Source Files ¶
- common.go
- config.go
- data_source_alicloud_common.go
- data_source_alicloud_images.go
- data_source_alicloud_instance_types.go
- data_source_alicloud_regions.go
- data_source_alicloud_zones.go
- errors.go
- extension_ecs.go
- extension_slb.go
- extension_tags.go
- provider.go
- resource_alicloud_db_instance.go
- resource_alicloud_disk.go
- resource_alicloud_disk_attachment.go
- resource_alicloud_eip.go
- resource_alicloud_eip_association.go
- resource_alicloud_ess_scalingconfiguration.go
- resource_alicloud_ess_scalinggroup.go
- resource_alicloud_ess_scalingrule.go
- resource_alicloud_ess_schedule.go
- resource_alicloud_forward.go
- resource_alicloud_instance.go
- resource_alicloud_nat_gateway.go
- resource_alicloud_security_group.go
- resource_alicloud_security_group_rule.go
- resource_alicloud_slb.go
- resource_alicloud_slb_attachment.go
- resource_alicloud_snat.go
- resource_alicloud_vpc.go
- resource_alicloud_vroute_entry.go
- resource_alicloud_vswitch.go
- service_alicloud_ecs.go
- service_alicloud_ess.go
- service_alicloud_rds.go
- service_alicloud_slb.go
- service_alicloud_vpc.go
- tags.go
- validators.go
Click to show internal directories.
Click to hide internal directories.