aws.s3control.AccessGrantsLocation
Explore with Pulumi AI
Provides a resource to manage an S3 Access Grants location. A location is an S3 resource (bucket or prefix) in a permission grant that the grantee can access. The S3 data must be in the same Region as your S3 Access Grants instance. When you register a location, you must include the IAM role that has permission to manage the S3 location that you are registering.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.s3control.AccessGrantsInstance("example", {});
const exampleAccessGrantsLocation = new aws.s3control.AccessGrantsLocation("example", {
iamRoleArn: exampleAwsIamRole.arn,
locationScope: "s3://",
}, {
dependsOn: [example],
});
import pulumi
import pulumi_aws as aws
example = aws.s3control.AccessGrantsInstance("example")
example_access_grants_location = aws.s3control.AccessGrantsLocation("example",
iam_role_arn=example_aws_iam_role["arn"],
location_scope="s3://",
opts = pulumi.ResourceOptions(depends_on=[example]))
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3control"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := s3control.NewAccessGrantsInstance(ctx, "example", nil)
if err != nil {
return err
}
_, err = s3control.NewAccessGrantsLocation(ctx, "example", &s3control.AccessGrantsLocationArgs{
IamRoleArn: pulumi.Any(exampleAwsIamRole.Arn),
LocationScope: pulumi.String("s3://"),
}, pulumi.DependsOn([]pulumi.Resource{
example,
}))
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 example = new Aws.S3Control.AccessGrantsInstance("example");
var exampleAccessGrantsLocation = new Aws.S3Control.AccessGrantsLocation("example", new()
{
IamRoleArn = exampleAwsIamRole.Arn,
LocationScope = "s3://",
}, new CustomResourceOptions
{
DependsOn =
{
example,
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.s3control.AccessGrantsInstance;
import com.pulumi.aws.s3control.AccessGrantsLocation;
import com.pulumi.aws.s3control.AccessGrantsLocationArgs;
import com.pulumi.resources.CustomResourceOptions;
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) {
var example = new AccessGrantsInstance("example");
var exampleAccessGrantsLocation = new AccessGrantsLocation("exampleAccessGrantsLocation", AccessGrantsLocationArgs.builder()
.iamRoleArn(exampleAwsIamRole.arn())
.locationScope("s3://")
.build(), CustomResourceOptions.builder()
.dependsOn(example)
.build());
}
}
resources:
example:
type: aws:s3control:AccessGrantsInstance
exampleAccessGrantsLocation:
type: aws:s3control:AccessGrantsLocation
name: example
properties:
iamRoleArn: ${exampleAwsIamRole.arn}
locationScope: s3://
options:
dependson:
- ${example}
Create AccessGrantsLocation Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new AccessGrantsLocation(name: string, args: AccessGrantsLocationArgs, opts?: CustomResourceOptions);
@overload
def AccessGrantsLocation(resource_name: str,
args: AccessGrantsLocationArgs,
opts: Optional[ResourceOptions] = None)
@overload
def AccessGrantsLocation(resource_name: str,
opts: Optional[ResourceOptions] = None,
iam_role_arn: Optional[str] = None,
location_scope: Optional[str] = None,
account_id: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None)
func NewAccessGrantsLocation(ctx *Context, name string, args AccessGrantsLocationArgs, opts ...ResourceOption) (*AccessGrantsLocation, error)
public AccessGrantsLocation(string name, AccessGrantsLocationArgs args, CustomResourceOptions? opts = null)
public AccessGrantsLocation(String name, AccessGrantsLocationArgs args)
public AccessGrantsLocation(String name, AccessGrantsLocationArgs args, CustomResourceOptions options)
type: aws:s3control:AccessGrantsLocation
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 AccessGrantsLocationArgs
- 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 AccessGrantsLocationArgs
- 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 AccessGrantsLocationArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AccessGrantsLocationArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args AccessGrantsLocationArgs
- 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 accessGrantsLocationResource = new Aws.S3Control.AccessGrantsLocation("accessGrantsLocationResource", new()
{
IamRoleArn = "string",
LocationScope = "string",
AccountId = "string",
Tags =
{
{ "string", "string" },
},
});
example, err := s3control.NewAccessGrantsLocation(ctx, "accessGrantsLocationResource", &s3control.AccessGrantsLocationArgs{
IamRoleArn: pulumi.String("string"),
LocationScope: pulumi.String("string"),
AccountId: pulumi.String("string"),
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
var accessGrantsLocationResource = new AccessGrantsLocation("accessGrantsLocationResource", AccessGrantsLocationArgs.builder()
.iamRoleArn("string")
.locationScope("string")
.accountId("string")
.tags(Map.of("string", "string"))
.build());
access_grants_location_resource = aws.s3control.AccessGrantsLocation("accessGrantsLocationResource",
iam_role_arn="string",
location_scope="string",
account_id="string",
tags={
"string": "string",
})
const accessGrantsLocationResource = new aws.s3control.AccessGrantsLocation("accessGrantsLocationResource", {
iamRoleArn: "string",
locationScope: "string",
accountId: "string",
tags: {
string: "string",
},
});
type: aws:s3control:AccessGrantsLocation
properties:
accountId: string
iamRoleArn: string
locationScope: string
tags:
string: string
AccessGrantsLocation 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 AccessGrantsLocation resource accepts the following input properties:
- Iam
Role stringArn - The ARN of the IAM role that S3 Access Grants should use when fulfilling runtime access requests to the location.
- Location
Scope string - The default S3 URI
s3://
or the URI to a custom location, a specific bucket or prefix. - Account
Id string - Dictionary<string, string>
- Key-value map of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- Iam
Role stringArn - The ARN of the IAM role that S3 Access Grants should use when fulfilling runtime access requests to the location.
- Location
Scope string - The default S3 URI
s3://
or the URI to a custom location, a specific bucket or prefix. - Account
Id string - map[string]string
- Key-value map of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- iam
Role StringArn - The ARN of the IAM role that S3 Access Grants should use when fulfilling runtime access requests to the location.
- location
Scope String - The default S3 URI
s3://
or the URI to a custom location, a specific bucket or prefix. - account
Id String - Map<String,String>
- Key-value map of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- iam
Role stringArn - The ARN of the IAM role that S3 Access Grants should use when fulfilling runtime access requests to the location.
- location
Scope string - The default S3 URI
s3://
or the URI to a custom location, a specific bucket or prefix. - account
Id string - {[key: string]: string}
- Key-value map of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- iam_
role_ strarn - The ARN of the IAM role that S3 Access Grants should use when fulfilling runtime access requests to the location.
- location_
scope str - The default S3 URI
s3://
or the URI to a custom location, a specific bucket or prefix. - account_
id str - Mapping[str, str]
- Key-value map of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- iam
Role StringArn - The ARN of the IAM role that S3 Access Grants should use when fulfilling runtime access requests to the location.
- location
Scope String - The default S3 URI
s3://
or the URI to a custom location, a specific bucket or prefix. - account
Id String - Map<String>
- Key-value map of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Outputs
All input properties are implicitly available as output properties. Additionally, the AccessGrantsLocation resource produces the following output properties:
- Access
Grants stringLocation Arn - Amazon Resource Name (ARN) of the S3 Access Grants location.
- Access
Grants stringLocation Id - Unique ID of the S3 Access Grants location.
- Id string
- The provider-assigned unique ID for this managed resource.
- Dictionary<string, string>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- Access
Grants stringLocation Arn - Amazon Resource Name (ARN) of the S3 Access Grants location.
- Access
Grants stringLocation Id - Unique ID of the S3 Access Grants location.
- Id string
- The provider-assigned unique ID for this managed resource.
- map[string]string
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- access
Grants StringLocation Arn - Amazon Resource Name (ARN) of the S3 Access Grants location.
- access
Grants StringLocation Id - Unique ID of the S3 Access Grants location.
- id String
- The provider-assigned unique ID for this managed resource.
- Map<String,String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- access
Grants stringLocation Arn - Amazon Resource Name (ARN) of the S3 Access Grants location.
- access
Grants stringLocation Id - Unique ID of the S3 Access Grants location.
- id string
- The provider-assigned unique ID for this managed resource.
- {[key: string]: string}
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- access_
grants_ strlocation_ arn - Amazon Resource Name (ARN) of the S3 Access Grants location.
- access_
grants_ strlocation_ id - Unique ID of the S3 Access Grants location.
- id str
- The provider-assigned unique ID for this managed resource.
- Mapping[str, str]
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- access
Grants StringLocation Arn - Amazon Resource Name (ARN) of the S3 Access Grants location.
- access
Grants StringLocation Id - Unique ID of the S3 Access Grants location.
- id String
- The provider-assigned unique ID for this managed resource.
- Map<String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
Look up Existing AccessGrantsLocation Resource
Get an existing AccessGrantsLocation 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?: AccessGrantsLocationState, opts?: CustomResourceOptions): AccessGrantsLocation
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
access_grants_location_arn: Optional[str] = None,
access_grants_location_id: Optional[str] = None,
account_id: Optional[str] = None,
iam_role_arn: Optional[str] = None,
location_scope: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
tags_all: Optional[Mapping[str, str]] = None) -> AccessGrantsLocation
func GetAccessGrantsLocation(ctx *Context, name string, id IDInput, state *AccessGrantsLocationState, opts ...ResourceOption) (*AccessGrantsLocation, error)
public static AccessGrantsLocation Get(string name, Input<string> id, AccessGrantsLocationState? state, CustomResourceOptions? opts = null)
public static AccessGrantsLocation get(String name, Output<String> id, AccessGrantsLocationState 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.
- Access
Grants stringLocation Arn - Amazon Resource Name (ARN) of the S3 Access Grants location.
- Access
Grants stringLocation Id - Unique ID of the S3 Access Grants location.
- Account
Id string - Iam
Role stringArn - The ARN of the IAM role that S3 Access Grants should use when fulfilling runtime access requests to the location.
- Location
Scope string - The default S3 URI
s3://
or the URI to a custom location, a specific bucket or prefix. - Dictionary<string, string>
- Key-value map of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Dictionary<string, string>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- Access
Grants stringLocation Arn - Amazon Resource Name (ARN) of the S3 Access Grants location.
- Access
Grants stringLocation Id - Unique ID of the S3 Access Grants location.
- Account
Id string - Iam
Role stringArn - The ARN of the IAM role that S3 Access Grants should use when fulfilling runtime access requests to the location.
- Location
Scope string - The default S3 URI
s3://
or the URI to a custom location, a specific bucket or prefix. - map[string]string
- Key-value map of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - map[string]string
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- access
Grants StringLocation Arn - Amazon Resource Name (ARN) of the S3 Access Grants location.
- access
Grants StringLocation Id - Unique ID of the S3 Access Grants location.
- account
Id String - iam
Role StringArn - The ARN of the IAM role that S3 Access Grants should use when fulfilling runtime access requests to the location.
- location
Scope String - The default S3 URI
s3://
or the URI to a custom location, a specific bucket or prefix. - Map<String,String>
- Key-value map of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Map<String,String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- access
Grants stringLocation Arn - Amazon Resource Name (ARN) of the S3 Access Grants location.
- access
Grants stringLocation Id - Unique ID of the S3 Access Grants location.
- account
Id string - iam
Role stringArn - The ARN of the IAM role that S3 Access Grants should use when fulfilling runtime access requests to the location.
- location
Scope string - The default S3 URI
s3://
or the URI to a custom location, a specific bucket or prefix. - {[key: string]: string}
- Key-value map of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - {[key: string]: string}
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- access_
grants_ strlocation_ arn - Amazon Resource Name (ARN) of the S3 Access Grants location.
- access_
grants_ strlocation_ id - Unique ID of the S3 Access Grants location.
- account_
id str - iam_
role_ strarn - The ARN of the IAM role that S3 Access Grants should use when fulfilling runtime access requests to the location.
- location_
scope str - The default S3 URI
s3://
or the URI to a custom location, a specific bucket or prefix. - Mapping[str, str]
- Key-value map of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Mapping[str, str]
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- access
Grants StringLocation Arn - Amazon Resource Name (ARN) of the S3 Access Grants location.
- access
Grants StringLocation Id - Unique ID of the S3 Access Grants location.
- account
Id String - iam
Role StringArn - The ARN of the IAM role that S3 Access Grants should use when fulfilling runtime access requests to the location.
- location
Scope String - The default S3 URI
s3://
or the URI to a custom location, a specific bucket or prefix. - Map<String>
- Key-value map of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Map<String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
Import
Using pulumi import
, import S3 Access Grants locations using the account_id
and access_grants_location_id
, separated by a comma (,
). For example:
$ pulumi import aws:s3control/accessGrantsLocation:AccessGrantsLocation example 123456789012,default
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.