pulumi/tests/integration/aliases/go/rename/step2/main.go

26 lines
557 B
Go

// Copyright 2016-2020, Pulumi Corporation. All rights reserved.
//go:build !all
// +build !all
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// FooComponent is a component resource
type FooComponent struct {
pulumi.ResourceState
}
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
fooComponent := &FooComponent{}
alias := &pulumi.Alias{
Name: pulumi.String("foo"),
}
opts := pulumi.Aliases([]pulumi.Alias{*alias})
return ctx.RegisterComponentResource("foo:component", "newfoo", fooComponent, opts)
})
}