/
getDomain.go
157 lines (136 loc) · 5.12 KB
/
getDomain.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
157
// 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 index
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to retrieve a domain from Okta.
//
// - https://developer.okta.com/docs/reference/api/domains/#get-domain
// - https://developer.okta.com/docs/reference/api/domains/#domainresponse-object
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-okta/sdk/v3/go/okta"
// "github.com/pulumi/pulumi-okta/sdk/v3/go/okta/Index"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := okta.NewDomain(ctx, "example", nil)
// if err != nil {
// return err
// }
// _, err = Index.GetDomain(ctx, &index.GetDomainArgs{
// DomainIdOrName: "www.example.com",
// }, nil)
// if err != nil {
// return err
// }
// _ = Index.GetDomainOutput(ctx, index.GetDomainOutputArgs{
// DomainIdOrName: example.ID(),
// }, nil)
// return nil
// })
// }
//
// ```
func GetDomain(ctx *pulumi.Context, args *GetDomainArgs, opts ...pulumi.InvokeOption) (*GetDomainResult, error) {
var rv GetDomainResult
err := ctx.Invoke("okta:Index/getDomain:getDomain", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getDomain.
type GetDomainArgs struct {
// The Okta ID of the domain or the domain name itself.
DomainIdOrName string `pulumi:"domainIdOrName"`
}
// A collection of values returned by getDomain.
type GetDomainResult struct {
// Certificate source type that indicates whether the certificate is provided by the user or Okta. Values: MANUAL, OKTA_MANAGED"
CertificateSourceType string `pulumi:"certificateSourceType"`
// TXT and CNAME records to be registered for the Domain.
DnsRecords []GetDomainDnsRecord `pulumi:"dnsRecords"`
// Domain name
Domain string `pulumi:"domain"`
DomainIdOrName string `pulumi:"domainIdOrName"`
// Domain ID
Id string `pulumi:"id"`
// Certificate metadata for the Domain
PublicCertificate map[string]string `pulumi:"publicCertificate"`
// Status of the domain. Values: `NOT_STARTED`, `IN_PROGRESS`, `VERIFIED`, `COMPLETED`
ValidationStatus string `pulumi:"validationStatus"`
}
func GetDomainOutput(ctx *pulumi.Context, args GetDomainOutputArgs, opts ...pulumi.InvokeOption) GetDomainResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (GetDomainResult, error) {
args := v.(GetDomainArgs)
r, err := GetDomain(ctx, &args, opts...)
var s GetDomainResult
if r != nil {
s = *r
}
return s, err
}).(GetDomainResultOutput)
}
// A collection of arguments for invoking getDomain.
type GetDomainOutputArgs struct {
// The Okta ID of the domain or the domain name itself.
DomainIdOrName pulumi.StringInput `pulumi:"domainIdOrName"`
}
func (GetDomainOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*GetDomainArgs)(nil)).Elem()
}
// A collection of values returned by getDomain.
type GetDomainResultOutput struct{ *pulumi.OutputState }
func (GetDomainResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GetDomainResult)(nil)).Elem()
}
func (o GetDomainResultOutput) ToGetDomainResultOutput() GetDomainResultOutput {
return o
}
func (o GetDomainResultOutput) ToGetDomainResultOutputWithContext(ctx context.Context) GetDomainResultOutput {
return o
}
// Certificate source type that indicates whether the certificate is provided by the user or Okta. Values: MANUAL, OKTA_MANAGED"
func (o GetDomainResultOutput) CertificateSourceType() pulumi.StringOutput {
return o.ApplyT(func(v GetDomainResult) string { return v.CertificateSourceType }).(pulumi.StringOutput)
}
// TXT and CNAME records to be registered for the Domain.
func (o GetDomainResultOutput) DnsRecords() GetDomainDnsRecordArrayOutput {
return o.ApplyT(func(v GetDomainResult) []GetDomainDnsRecord { return v.DnsRecords }).(GetDomainDnsRecordArrayOutput)
}
// Domain name
func (o GetDomainResultOutput) Domain() pulumi.StringOutput {
return o.ApplyT(func(v GetDomainResult) string { return v.Domain }).(pulumi.StringOutput)
}
func (o GetDomainResultOutput) DomainIdOrName() pulumi.StringOutput {
return o.ApplyT(func(v GetDomainResult) string { return v.DomainIdOrName }).(pulumi.StringOutput)
}
// Domain ID
func (o GetDomainResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v GetDomainResult) string { return v.Id }).(pulumi.StringOutput)
}
// Certificate metadata for the Domain
func (o GetDomainResultOutput) PublicCertificate() pulumi.StringMapOutput {
return o.ApplyT(func(v GetDomainResult) map[string]string { return v.PublicCertificate }).(pulumi.StringMapOutput)
}
// Status of the domain. Values: `NOT_STARTED`, `IN_PROGRESS`, `VERIFIED`, `COMPLETED`
func (o GetDomainResultOutput) ValidationStatus() pulumi.StringOutput {
return o.ApplyT(func(v GetDomainResult) string { return v.ValidationStatus }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(GetDomainResultOutput{})
}