aws.inspector2.DelegatedAdminAccount
Explore with Pulumi AI
Resource for managing an Amazon Inspector Delegated Admin Account.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const current = aws.getCallerIdentity({});
const example = new aws.inspector2.DelegatedAdminAccount("example", {accountId: current.then(current => current.accountId)});
import pulumi
import pulumi_aws as aws
current = aws.get_caller_identity()
example = aws.inspector2.DelegatedAdminAccount("example", account_id=current.account_id)
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/inspector2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
current, err := aws.GetCallerIdentity(ctx, &aws.GetCallerIdentityArgs{}, nil)
if err != nil {
return err
}
_, err = inspector2.NewDelegatedAdminAccount(ctx, "example", &inspector2.DelegatedAdminAccountArgs{
AccountId: pulumi.String(current.AccountId),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var current = Aws.GetCallerIdentity.Invoke();
var example = new Aws.Inspector2.DelegatedAdminAccount("example", new()
{
AccountId = current.Apply(getCallerIdentityResult => getCallerIdentityResult.AccountId),
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.AwsFunctions;
import com.pulumi.aws.inputs.GetCallerIdentityArgs;
import com.pulumi.aws.inspector2.DelegatedAdminAccount;
import com.pulumi.aws.inspector2.DelegatedAdminAccountArgs;
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 current = AwsFunctions.getCallerIdentity();
var example = new DelegatedAdminAccount("example", DelegatedAdminAccountArgs.builder()
.accountId(current.applyValue(getCallerIdentityResult -> getCallerIdentityResult.accountId()))
.build());
}
}
resources:
example:
type: aws:inspector2:DelegatedAdminAccount
properties:
accountId: ${current.accountId}
variables:
current:
fn::invoke:
Function: aws:getCallerIdentity
Arguments: {}
Create DelegatedAdminAccount Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new DelegatedAdminAccount(name: string, args: DelegatedAdminAccountArgs, opts?: CustomResourceOptions);
@overload
def DelegatedAdminAccount(resource_name: str,
args: DelegatedAdminAccountArgs,
opts: Optional[ResourceOptions] = None)
@overload
def DelegatedAdminAccount(resource_name: str,
opts: Optional[ResourceOptions] = None,
account_id: Optional[str] = None)
func NewDelegatedAdminAccount(ctx *Context, name string, args DelegatedAdminAccountArgs, opts ...ResourceOption) (*DelegatedAdminAccount, error)
public DelegatedAdminAccount(string name, DelegatedAdminAccountArgs args, CustomResourceOptions? opts = null)
public DelegatedAdminAccount(String name, DelegatedAdminAccountArgs args)
public DelegatedAdminAccount(String name, DelegatedAdminAccountArgs args, CustomResourceOptions options)
type: aws:inspector2:DelegatedAdminAccount
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args DelegatedAdminAccountArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args DelegatedAdminAccountArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args DelegatedAdminAccountArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DelegatedAdminAccountArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args DelegatedAdminAccountArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var delegatedAdminAccountResource = new Aws.Inspector2.DelegatedAdminAccount("delegatedAdminAccountResource", new()
{
AccountId = "string",
});
example, err := inspector2.NewDelegatedAdminAccount(ctx, "delegatedAdminAccountResource", &inspector2.DelegatedAdminAccountArgs{
AccountId: pulumi.String("string"),
})
var delegatedAdminAccountResource = new DelegatedAdminAccount("delegatedAdminAccountResource", DelegatedAdminAccountArgs.builder()
.accountId("string")
.build());
delegated_admin_account_resource = aws.inspector2.DelegatedAdminAccount("delegatedAdminAccountResource", account_id="string")
const delegatedAdminAccountResource = new aws.inspector2.DelegatedAdminAccount("delegatedAdminAccountResource", {accountId: "string"});
type: aws:inspector2:DelegatedAdminAccount
properties:
accountId: string
DelegatedAdminAccount Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The DelegatedAdminAccount resource accepts the following input properties:
- Account
Id string - Account to enable as delegated admin account.
- Account
Id string - Account to enable as delegated admin account.
- account
Id String - Account to enable as delegated admin account.
- account
Id string - Account to enable as delegated admin account.
- account_
id str - Account to enable as delegated admin account.
- account
Id String - Account to enable as delegated admin account.
Outputs
All input properties are implicitly available as output properties. Additionally, the DelegatedAdminAccount resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Relationship
Status string - Status of this delegated admin account.
- Id string
- The provider-assigned unique ID for this managed resource.
- Relationship
Status string - Status of this delegated admin account.
- id String
- The provider-assigned unique ID for this managed resource.
- relationship
Status String - Status of this delegated admin account.
- id string
- The provider-assigned unique ID for this managed resource.
- relationship
Status string - Status of this delegated admin account.
- id str
- The provider-assigned unique ID for this managed resource.
- relationship_
status str - Status of this delegated admin account.
- id String
- The provider-assigned unique ID for this managed resource.
- relationship
Status String - Status of this delegated admin account.
Look up Existing DelegatedAdminAccount Resource
Get an existing DelegatedAdminAccount resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: DelegatedAdminAccountState, opts?: CustomResourceOptions): DelegatedAdminAccount
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
account_id: Optional[str] = None,
relationship_status: Optional[str] = None) -> DelegatedAdminAccount
func GetDelegatedAdminAccount(ctx *Context, name string, id IDInput, state *DelegatedAdminAccountState, opts ...ResourceOption) (*DelegatedAdminAccount, error)
public static DelegatedAdminAccount Get(string name, Input<string> id, DelegatedAdminAccountState? state, CustomResourceOptions? opts = null)
public static DelegatedAdminAccount get(String name, Output<String> id, DelegatedAdminAccountState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Account
Id string - Account to enable as delegated admin account.
- Relationship
Status string - Status of this delegated admin account.
- Account
Id string - Account to enable as delegated admin account.
- Relationship
Status string - Status of this delegated admin account.
- account
Id String - Account to enable as delegated admin account.
- relationship
Status String - Status of this delegated admin account.
- account
Id string - Account to enable as delegated admin account.
- relationship
Status string - Status of this delegated admin account.
- account_
id str - Account to enable as delegated admin account.
- relationship_
status str - Status of this delegated admin account.
- account
Id String - Account to enable as delegated admin account.
- relationship
Status String - Status of this delegated admin account.
Import
Using pulumi import
, import Inspector Delegated Admin Account using the account_id
. For example:
$ pulumi import aws:inspector2/delegatedAdminAccount:DelegatedAdminAccount example 123456789012
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.