static Task <int> Main() { return(Deployment.RunAsync(() => { var config = new Config(); var statefile = config.Require("statefile"); var remoteState = new RemoteStateReference("localstate", new LocalBackendRemoteStateReferenceArgs { Path = Path.GetFullPath(statefile), }); return new Dictionary <string, object?> { { "vpcId", remoteState.GetOutput("vpc_id") }, { "publicSubnetIds", remoteState.GetOutput("public_subnet_ids") }, { "bucketArn", remoteState.GetOutput("bucket_arn") }, }; })); }
static Task <int> Main() { return(Deployment.RunAsync(() => { var config = new Config(); var bucketName = config.Require("bucketName"); var key = config.Require("key"); var region = config.Require("region"); var remoteState = new RemoteStateReference("s3state", new S3RemoteStateReferenceArgs { Bucket = bucketName, Key = key + "/terraform.tfstate", Region = region, }); return new Dictionary <string, object?> { { "vpcId", remoteState.GetOutput("vpc_id") }, { "publicSubnetIds", remoteState.GetOutput("public_subnet_ids") }, { "bucketArn", remoteState.GetOutput("bucket_arn") }, }; })); }
static Task <int> Main() { return(Deployment.RunAsync(() => { var config = new Config(); var tfeToken = config.RequireSecret("tfeToken"); var organization = config.Require("organization"); var workspaceName = config.Require("workspaceName"); var remoteState = new RemoteStateReference("remote-backend-state", new RemoteBackendRemoteStateReferenceArgs() { Token = tfeToken, Organization = organization, Workspaces = new RemoteBackendWorkspaceConfig() { Name = workspaceName, } }); return new Dictionary <string, object?> { { "password", remoteState.GetOutput("password") }, }; })); }