mirror of https://github.com/pulumi/pulumi.git
25 lines
497 B
Go
25 lines
497 B
Go
package main
|
|
|
|
import (
|
|
"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/ec2"
|
|
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
|
)
|
|
|
|
func main() {
|
|
pulumi.Run(func(ctx *pulumi.Context) error {
|
|
invokeLookupVpc, err := ec2.LookupVpc(ctx, &ec2.LookupVpcArgs{
|
|
Default: pulumi.BoolRef(true),
|
|
}, nil)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = ec2.NewSecurityGroup(ctx, "webSecurityGroup", &ec2.SecurityGroupArgs{
|
|
VpcId: invokeLookupVpc.Id,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
})
|
|
}
|