45 lines
1.0 KiB
Go
45 lines
1.0 KiB
Go
package main
|
|
|
|
import (
|
|
"github.com/pulumi/pulumi-oci/sdk/go/oci/identity"
|
|
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
|
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
|
|
)
|
|
|
|
func main() {
|
|
pulumi.Run(func(ctx *pulumi.Context) error {
|
|
ocicfg := config.New(ctx, "oci")
|
|
|
|
// My Compartment
|
|
compartment, err := identity.NewCompartment(ctx, "compartment", &identity.CompartmentArgs{
|
|
Name: pulumi.Sprintf("%s-happydomain-compartment", ctx.Stack()),
|
|
Description: pulumi.String("Compartment for happyDomain"),
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
ns, listmonkAuthToken, err := setupListmonkStorage(ctx, ocicfg, compartment)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
pemprvkey, smtpcreds, err := setupEmails(ctx, ocicfg, compartment)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
subnet, err := setupNetwork(ctx, compartment)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = setupHostMain(ctx, ocicfg, compartment, ns, subnet, listmonkAuthToken, smtpcreds, pemprvkey)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
})
|
|
}
|