1. Packages
  2. Grafana Cloud
  3. API Docs
  4. cloudProvider
  5. getAwsAccount
Grafana v0.16.3 published on Monday, Apr 7, 2025 by pulumiverse

grafana.cloudProvider.getAwsAccount

Explore with Pulumi AI

Grafana v0.16.3 published on Monday, Apr 7, 2025 by pulumiverse

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as grafana from "@pulumi/grafana";
import * as grafana from "@pulumiverse/grafana";

const test = grafana.cloud.getStack({
    slug: "gcloudstacktest",
});
const testAwsAccount = new grafana.cloudprovider.AwsAccount("test", {
    stackId: test.then(test => test.id),
    roleArn: testAwsIamRole.arn,
    regions: [
        "us-east-2",
        "eu-west-3",
    ],
});
const testGetAwsAccount = pulumi.all([test, testAwsAccount.resourceId]).apply(([test, resourceId]) => grafana.cloudProvider.getAwsAccountOutput({
    stackId: test.id,
    resourceId: resourceId,
}));
Copy
import pulumi
import pulumi_grafana as grafana
import pulumiverse_grafana as grafana

test = grafana.cloud.get_stack(slug="gcloudstacktest")
test_aws_account = grafana.cloud_provider.AwsAccount("test",
    stack_id=test.id,
    role_arn=test_aws_iam_role["arn"],
    regions=[
        "us-east-2",
        "eu-west-3",
    ])
test_get_aws_account = test_aws_account.resource_id.apply(lambda resource_id: grafana.cloudProvider.get_aws_account_output(stack_id=test.id,
    resource_id=resource_id))
Copy
package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumiverse/pulumi-grafana/sdk/go/grafana/cloud"
	"github.com/pulumiverse/pulumi-grafana/sdk/go/grafana/cloudprovider"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		test, err := cloud.LookupStack(ctx, &cloud.LookupStackArgs{
			Slug: "gcloudstacktest",
		}, nil)
		if err != nil {
			return err
		}
		testAwsAccount, err := cloudprovider.NewAwsAccount(ctx, "test", &cloudprovider.AwsAccountArgs{
			StackId: pulumi.String(test.Id),
			RoleArn: pulumi.Any(testAwsIamRole.Arn),
			Regions: pulumi.StringArray{
				pulumi.String("us-east-2"),
				pulumi.String("eu-west-3"),
			},
		})
		if err != nil {
			return err
		}
		_ = testAwsAccount.ResourceId.ApplyT(func(resourceId string) (cloudprovider.GetAwsAccountResult, error) {
			return cloudprovider.GetAwsAccountResult(interface{}(cloudprovider.GetAwsAccountOutput(ctx, cloudprovider.GetAwsAccountOutputArgs{
				StackId:    test.Id,
				ResourceId: resourceId,
			}, nil))), nil
		}).(cloudprovider.GetAwsAccountResultOutput)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Grafana = Pulumi.Grafana;
using Grafana = Pulumiverse.Grafana;

return await Deployment.RunAsync(() => 
{
    var test = Grafana.Cloud.GetStack.Invoke(new()
    {
        Slug = "gcloudstacktest",
    });

    var testAwsAccount = new Grafana.CloudProvider.AwsAccount("test", new()
    {
        StackId = test.Apply(getStackResult => getStackResult.Id),
        RoleArn = testAwsIamRole.Arn,
        Regions = new[]
        {
            "us-east-2",
            "eu-west-3",
        },
    });

    var testGetAwsAccount = Grafana.CloudProvider.GetAwsAccount.Invoke(new()
    {
        StackId = test.Apply(getStackResult => getStackResult.Id),
        ResourceId = testAwsAccount.ResourceId,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.grafana.cloud.CloudFunctions;
import com.pulumi.grafana.cloud.inputs.GetStackArgs;
import com.pulumi.grafana.cloudProvider.AwsAccount;
import com.pulumi.grafana.cloudProvider.AwsAccountArgs;
import com.pulumi.grafana.cloudProvider.CloudProviderFunctions;
import com.pulumi.grafana.cloudProvider.inputs.GetAwsAccountArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var test = CloudFunctions.getStack(GetStackArgs.builder()
            .slug("gcloudstacktest")
            .build());

        var testAwsAccount = new AwsAccount("testAwsAccount", AwsAccountArgs.builder()
            .stackId(test.applyValue(getStackResult -> getStackResult.id()))
            .roleArn(testAwsIamRole.arn())
            .regions(            
                "us-east-2",
                "eu-west-3")
            .build());

        final var testGetAwsAccount = CloudProviderFunctions.getAwsAccount(GetAwsAccountArgs.builder()
            .stackId(test.applyValue(getStackResult -> getStackResult.id()))
            .resourceId(testAwsAccount.resourceId())
            .build());

    }
}
Copy
resources:
  testAwsAccount:
    type: grafana:cloudProvider:AwsAccount
    name: test
    properties:
      stackId: ${test.id}
      roleArn: ${testAwsIamRole.arn}
      regions:
        - us-east-2
        - eu-west-3
variables:
  test:
    fn::invoke:
      function: grafana:cloud:getStack
      arguments:
        slug: gcloudstacktest
  testGetAwsAccount:
    fn::invoke:
      function: grafana:cloudProvider:getAwsAccount
      arguments:
        stackId: ${test.id}
        resourceId: ${testAwsAccount.resourceId}
Copy

Using getAwsAccount

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getAwsAccount(args: GetAwsAccountArgs, opts?: InvokeOptions): Promise<GetAwsAccountResult>
function getAwsAccountOutput(args: GetAwsAccountOutputArgs, opts?: InvokeOptions): Output<GetAwsAccountResult>
Copy
def get_aws_account(resource_id: Optional[str] = None,
                    stack_id: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetAwsAccountResult
def get_aws_account_output(resource_id: Optional[pulumi.Input[str]] = None,
                    stack_id: Optional[pulumi.Input[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetAwsAccountResult]
Copy
func GetAwsAccount(ctx *Context, args *GetAwsAccountArgs, opts ...InvokeOption) (*GetAwsAccountResult, error)
func GetAwsAccountOutput(ctx *Context, args *GetAwsAccountOutputArgs, opts ...InvokeOption) GetAwsAccountResultOutput
Copy

> Note: This function is named GetAwsAccount in the Go SDK.

public static class GetAwsAccount 
{
    public static Task<GetAwsAccountResult> InvokeAsync(GetAwsAccountArgs args, InvokeOptions? opts = null)
    public static Output<GetAwsAccountResult> Invoke(GetAwsAccountInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetAwsAccountResult> getAwsAccount(GetAwsAccountArgs args, InvokeOptions options)
public static Output<GetAwsAccountResult> getAwsAccount(GetAwsAccountArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: grafana:cloudProvider/getAwsAccount:getAwsAccount
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

ResourceId This property is required. string
The ID given by the Grafana Cloud Provider API to this AWS Account resource.
StackId This property is required. string
ResourceId This property is required. string
The ID given by the Grafana Cloud Provider API to this AWS Account resource.
StackId This property is required. string
resourceId This property is required. String
The ID given by the Grafana Cloud Provider API to this AWS Account resource.
stackId This property is required. String
resourceId This property is required. string
The ID given by the Grafana Cloud Provider API to this AWS Account resource.
stackId This property is required. string
resource_id This property is required. str
The ID given by the Grafana Cloud Provider API to this AWS Account resource.
stack_id This property is required. str
resourceId This property is required. String
The ID given by the Grafana Cloud Provider API to this AWS Account resource.
stackId This property is required. String

getAwsAccount Result

The following output properties are available:

Id string
Name string
An optional human-readable name for this AWS Account resource.
Regions List<string>
A set of regions that this AWS Account resource applies to.
ResourceId string
The ID given by the Grafana Cloud Provider API to this AWS Account resource.
RoleArn string
An IAM Role ARN string to represent with this AWS Account resource.
StackId string
Id string
Name string
An optional human-readable name for this AWS Account resource.
Regions []string
A set of regions that this AWS Account resource applies to.
ResourceId string
The ID given by the Grafana Cloud Provider API to this AWS Account resource.
RoleArn string
An IAM Role ARN string to represent with this AWS Account resource.
StackId string
id String
name String
An optional human-readable name for this AWS Account resource.
regions List<String>
A set of regions that this AWS Account resource applies to.
resourceId String
The ID given by the Grafana Cloud Provider API to this AWS Account resource.
roleArn String
An IAM Role ARN string to represent with this AWS Account resource.
stackId String
id string
name string
An optional human-readable name for this AWS Account resource.
regions string[]
A set of regions that this AWS Account resource applies to.
resourceId string
The ID given by the Grafana Cloud Provider API to this AWS Account resource.
roleArn string
An IAM Role ARN string to represent with this AWS Account resource.
stackId string
id str
name str
An optional human-readable name for this AWS Account resource.
regions Sequence[str]
A set of regions that this AWS Account resource applies to.
resource_id str
The ID given by the Grafana Cloud Provider API to this AWS Account resource.
role_arn str
An IAM Role ARN string to represent with this AWS Account resource.
stack_id str
id String
name String
An optional human-readable name for this AWS Account resource.
regions List<String>
A set of regions that this AWS Account resource applies to.
resourceId String
The ID given by the Grafana Cloud Provider API to this AWS Account resource.
roleArn String
An IAM Role ARN string to represent with this AWS Account resource.
stackId String

Package Details

Repository
grafana pulumiverse/pulumi-grafana
License
Apache-2.0
Notes
This Pulumi package is based on the grafana Terraform Provider.
Grafana v0.16.3 published on Monday, Apr 7, 2025 by pulumiverse