-
Notifications
You must be signed in to change notification settings - Fork 5
/
service.go
145 lines (132 loc) · 7.96 KB
/
service.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package fc
import (
"reflect"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
type Service struct {
pulumi.CustomResourceState
// The function compute service description.
Description pulumi.StringPtrOutput `pulumi:"description"`
// Whether to allow the service to access Internet. Default to "true".
InternetAccess pulumi.BoolPtrOutput `pulumi:"internetAccess"`
// The date this resource was last modified.
LastModified pulumi.StringOutput `pulumi:"lastModified"`
// Provide this to store your FC service logs. Fields documented below. See [Create a Service](https://www.alibabacloud.com/help/doc-detail/51924.htm).
LogConfig ServiceLogConfigPtrOutput `pulumi:"logConfig"`
// The Function Compute service name. It is the only in one Alicloud account and is conflict with "namePrefix".
Name pulumi.StringOutput `pulumi:"name"`
// Setting a prefix to get a only name. It is conflict with "name".
NamePrefix pulumi.StringPtrOutput `pulumi:"namePrefix"`
// RAM role arn attached to the Function Compute service. This governs both who / what can invoke your Function, as well as what resources our Function has access to. See [User Permissions](https://www.alibabacloud.com/help/doc-detail/52885.htm) for more details.
Role pulumi.StringPtrOutput `pulumi:"role"`
// The Function Compute service ID.
ServiceId pulumi.StringOutput `pulumi:"serviceId"`
// Provide this to allow your FC service to access your VPC. Fields documented below. See [Function Compute Service in VPC](https://www.alibabacloud.com/help/faq-detail/72959.htm).
VpcConfig ServiceVpcConfigPtrOutput `pulumi:"vpcConfig"`
}
// NewService registers a new resource with the given unique name, arguments, and options.
func NewService(ctx *pulumi.Context,
name string, args *ServiceArgs, opts ...pulumi.ResourceOption) (*Service, error) {
if args == nil {
args = &ServiceArgs{}
}
var resource Service
err := ctx.RegisterResource("alicloud:fc/service:Service", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetService gets an existing Service resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetService(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ServiceState, opts ...pulumi.ResourceOption) (*Service, error) {
var resource Service
err := ctx.ReadResource("alicloud:fc/service:Service", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Service resources.
type serviceState struct {
// The function compute service description.
Description *string `pulumi:"description"`
// Whether to allow the service to access Internet. Default to "true".
InternetAccess *bool `pulumi:"internetAccess"`
// The date this resource was last modified.
LastModified *string `pulumi:"lastModified"`
// Provide this to store your FC service logs. Fields documented below. See [Create a Service](https://www.alibabacloud.com/help/doc-detail/51924.htm).
LogConfig *ServiceLogConfig `pulumi:"logConfig"`
// The Function Compute service name. It is the only in one Alicloud account and is conflict with "namePrefix".
Name *string `pulumi:"name"`
// Setting a prefix to get a only name. It is conflict with "name".
NamePrefix *string `pulumi:"namePrefix"`
// RAM role arn attached to the Function Compute service. This governs both who / what can invoke your Function, as well as what resources our Function has access to. See [User Permissions](https://www.alibabacloud.com/help/doc-detail/52885.htm) for more details.
Role *string `pulumi:"role"`
// The Function Compute service ID.
ServiceId *string `pulumi:"serviceId"`
// Provide this to allow your FC service to access your VPC. Fields documented below. See [Function Compute Service in VPC](https://www.alibabacloud.com/help/faq-detail/72959.htm).
VpcConfig *ServiceVpcConfig `pulumi:"vpcConfig"`
}
type ServiceState struct {
// The function compute service description.
Description pulumi.StringPtrInput
// Whether to allow the service to access Internet. Default to "true".
InternetAccess pulumi.BoolPtrInput
// The date this resource was last modified.
LastModified pulumi.StringPtrInput
// Provide this to store your FC service logs. Fields documented below. See [Create a Service](https://www.alibabacloud.com/help/doc-detail/51924.htm).
LogConfig ServiceLogConfigPtrInput
// The Function Compute service name. It is the only in one Alicloud account and is conflict with "namePrefix".
Name pulumi.StringPtrInput
// Setting a prefix to get a only name. It is conflict with "name".
NamePrefix pulumi.StringPtrInput
// RAM role arn attached to the Function Compute service. This governs both who / what can invoke your Function, as well as what resources our Function has access to. See [User Permissions](https://www.alibabacloud.com/help/doc-detail/52885.htm) for more details.
Role pulumi.StringPtrInput
// The Function Compute service ID.
ServiceId pulumi.StringPtrInput
// Provide this to allow your FC service to access your VPC. Fields documented below. See [Function Compute Service in VPC](https://www.alibabacloud.com/help/faq-detail/72959.htm).
VpcConfig ServiceVpcConfigPtrInput
}
func (ServiceState) ElementType() reflect.Type {
return reflect.TypeOf((*serviceState)(nil)).Elem()
}
type serviceArgs struct {
// The function compute service description.
Description *string `pulumi:"description"`
// Whether to allow the service to access Internet. Default to "true".
InternetAccess *bool `pulumi:"internetAccess"`
// Provide this to store your FC service logs. Fields documented below. See [Create a Service](https://www.alibabacloud.com/help/doc-detail/51924.htm).
LogConfig *ServiceLogConfig `pulumi:"logConfig"`
// The Function Compute service name. It is the only in one Alicloud account and is conflict with "namePrefix".
Name *string `pulumi:"name"`
// Setting a prefix to get a only name. It is conflict with "name".
NamePrefix *string `pulumi:"namePrefix"`
// RAM role arn attached to the Function Compute service. This governs both who / what can invoke your Function, as well as what resources our Function has access to. See [User Permissions](https://www.alibabacloud.com/help/doc-detail/52885.htm) for more details.
Role *string `pulumi:"role"`
// Provide this to allow your FC service to access your VPC. Fields documented below. See [Function Compute Service in VPC](https://www.alibabacloud.com/help/faq-detail/72959.htm).
VpcConfig *ServiceVpcConfig `pulumi:"vpcConfig"`
}
// The set of arguments for constructing a Service resource.
type ServiceArgs struct {
// The function compute service description.
Description pulumi.StringPtrInput
// Whether to allow the service to access Internet. Default to "true".
InternetAccess pulumi.BoolPtrInput
// Provide this to store your FC service logs. Fields documented below. See [Create a Service](https://www.alibabacloud.com/help/doc-detail/51924.htm).
LogConfig ServiceLogConfigPtrInput
// The Function Compute service name. It is the only in one Alicloud account and is conflict with "namePrefix".
Name pulumi.StringPtrInput
// Setting a prefix to get a only name. It is conflict with "name".
NamePrefix pulumi.StringPtrInput
// RAM role arn attached to the Function Compute service. This governs both who / what can invoke your Function, as well as what resources our Function has access to. See [User Permissions](https://www.alibabacloud.com/help/doc-detail/52885.htm) for more details.
Role pulumi.StringPtrInput
// Provide this to allow your FC service to access your VPC. Fields documented below. See [Function Compute Service in VPC](https://www.alibabacloud.com/help/faq-detail/72959.htm).
VpcConfig ServiceVpcConfigPtrInput
}
func (ServiceArgs) ElementType() reflect.Type {
return reflect.TypeOf((*serviceArgs)(nil)).Elem()
}