2024-10-04 17:18:57 +00:00
|
|
|
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
|
|
|
|
}
|
|
|
|
|
2024-10-23 20:43:38 +00:00
|
|
|
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)
|
2024-10-04 17:18:57 +00:00
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
})
|
|
|
|
}
|