/
getCloudletsPhasedReleaseMatchRule.go
156 lines (139 loc) · 6.11 KB
/
getCloudletsPhasedReleaseMatchRule.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
146
147
148
149
150
151
152
153
154
155
156
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package akamai
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Every policy version specifies the match rules that govern how the Cloudlet is used. Matches specify conditions that need to be met in the incoming request.
//
// Use the `getCloudletsPhasedReleaseMatchRule` data source to build a match rule JSON object for the Phased Release Cloudlet.
//
// ## Basic usage
//
// This example returns the JSON-encoded rules for the Phased Release Cloudlet:
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-akamai/sdk/v2/go/akamai"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := akamai.GetCloudletsPhasedReleaseMatchRule(ctx, &GetCloudletsPhasedReleaseMatchRuleArgs{
// MatchRules: []GetCloudletsPhasedReleaseMatchRuleMatchRule{
// GetCloudletsPhasedReleaseMatchRuleMatchRule{
// End: pulumi.IntRef(1645037845),
// ForwardSettings: GetCloudletsPhasedReleaseMatchRuleMatchRuleForwardSettings{
// OriginId: "1234",
// Percent: 100,
// },
// Matches: []GetCloudletsPhasedReleaseMatchRuleMatchRuleMatch{
// GetCloudletsPhasedReleaseMatchRuleMatchRuleMatch{
// CaseSensitive: pulumi.BoolRef(false),
// CheckIps: pulumi.StringRef("CONNECTING_IP XFF_HEADERS"),
// MatchOperator: pulumi.StringRef("equals"),
// MatchType: pulumi.StringRef("header"),
// Negate: pulumi.BoolRef(false),
// ObjectMatchValue: []map[string]interface{}{
// map[string]interface{}{
// "name": "Content-Type",
// "options": map[string]interface{}{
// "value": []string{
// "application/json",
// },
// },
// "type": "object",
// },
// },
// },
// },
// Name: pulumi.StringRef("rule"),
// Start: pulumi.IntRef(1644865045),
// },
// },
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// ## Attributes reference
//
// This data source returns these attributes:
//
// * `type` - The type of Cloudlet the rule is for.
// * `json` - A `matchRules` JSON structure generated from the API schema that defines the rules for this policy.
func GetCloudletsPhasedReleaseMatchRule(ctx *pulumi.Context, args *GetCloudletsPhasedReleaseMatchRuleArgs, opts ...pulumi.InvokeOption) (*GetCloudletsPhasedReleaseMatchRuleResult, error) {
var rv GetCloudletsPhasedReleaseMatchRuleResult
err := ctx.Invoke("akamai:index/getCloudletsPhasedReleaseMatchRule:getCloudletsPhasedReleaseMatchRule", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getCloudletsPhasedReleaseMatchRule.
type GetCloudletsPhasedReleaseMatchRuleArgs struct {
// - (Optional) A list of Cloudlet-specific match rules for a policy.
MatchRules []GetCloudletsPhasedReleaseMatchRuleMatchRule `pulumi:"matchRules"`
}
// A collection of values returned by getCloudletsPhasedReleaseMatchRule.
type GetCloudletsPhasedReleaseMatchRuleResult struct {
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
Json string `pulumi:"json"`
MatchRules []GetCloudletsPhasedReleaseMatchRuleMatchRule `pulumi:"matchRules"`
}
func GetCloudletsPhasedReleaseMatchRuleOutput(ctx *pulumi.Context, args GetCloudletsPhasedReleaseMatchRuleOutputArgs, opts ...pulumi.InvokeOption) GetCloudletsPhasedReleaseMatchRuleResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (GetCloudletsPhasedReleaseMatchRuleResult, error) {
args := v.(GetCloudletsPhasedReleaseMatchRuleArgs)
r, err := GetCloudletsPhasedReleaseMatchRule(ctx, &args, opts...)
var s GetCloudletsPhasedReleaseMatchRuleResult
if r != nil {
s = *r
}
return s, err
}).(GetCloudletsPhasedReleaseMatchRuleResultOutput)
}
// A collection of arguments for invoking getCloudletsPhasedReleaseMatchRule.
type GetCloudletsPhasedReleaseMatchRuleOutputArgs struct {
// - (Optional) A list of Cloudlet-specific match rules for a policy.
MatchRules GetCloudletsPhasedReleaseMatchRuleMatchRuleArrayInput `pulumi:"matchRules"`
}
func (GetCloudletsPhasedReleaseMatchRuleOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*GetCloudletsPhasedReleaseMatchRuleArgs)(nil)).Elem()
}
// A collection of values returned by getCloudletsPhasedReleaseMatchRule.
type GetCloudletsPhasedReleaseMatchRuleResultOutput struct{ *pulumi.OutputState }
func (GetCloudletsPhasedReleaseMatchRuleResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GetCloudletsPhasedReleaseMatchRuleResult)(nil)).Elem()
}
func (o GetCloudletsPhasedReleaseMatchRuleResultOutput) ToGetCloudletsPhasedReleaseMatchRuleResultOutput() GetCloudletsPhasedReleaseMatchRuleResultOutput {
return o
}
func (o GetCloudletsPhasedReleaseMatchRuleResultOutput) ToGetCloudletsPhasedReleaseMatchRuleResultOutputWithContext(ctx context.Context) GetCloudletsPhasedReleaseMatchRuleResultOutput {
return o
}
// The provider-assigned unique ID for this managed resource.
func (o GetCloudletsPhasedReleaseMatchRuleResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v GetCloudletsPhasedReleaseMatchRuleResult) string { return v.Id }).(pulumi.StringOutput)
}
func (o GetCloudletsPhasedReleaseMatchRuleResultOutput) Json() pulumi.StringOutput {
return o.ApplyT(func(v GetCloudletsPhasedReleaseMatchRuleResult) string { return v.Json }).(pulumi.StringOutput)
}
func (o GetCloudletsPhasedReleaseMatchRuleResultOutput) MatchRules() GetCloudletsPhasedReleaseMatchRuleMatchRuleArrayOutput {
return o.ApplyT(func(v GetCloudletsPhasedReleaseMatchRuleResult) []GetCloudletsPhasedReleaseMatchRuleMatchRule {
return v.MatchRules
}).(GetCloudletsPhasedReleaseMatchRuleMatchRuleArrayOutput)
}
func init() {
pulumi.RegisterOutputType(GetCloudletsPhasedReleaseMatchRuleResultOutput{})
}