Control access to Lightsail buckets for instances
Attach an Amazon Lightsail instance to a Lightsail bucket to give it full programmatic access to the bucket and its objects. When you attach instances to buckets, you don't have to manage credentials like access keys. The instances and buckets that you attach must be in the same AWS Region. You cannot attach instances to buckets that are in a different Region.
Resource access is ideal if you're configuring software or a plugin on your instance to upload files directly to your bucket. For example, if you want to configure a WordPress instance to store media files on a bucket. For more information, see Tutorial: Connect a bucket to your WordPress instance.
For more information about permission options, see Bucket permissions. For more information about security best practices, see Security Best Practices for object storage. For more information about buckets, see Object storage.
Configure resource access for a bucket
Complete the following procedure to configure resource access for a bucket.
-
Sign in to the Lightsail console
. -
In the left navigation pane, choose Storage.
-
Choose the name of the bucket for which you want to configure resource access.
-
Choose the Permissions tab.
The Resource access section of the page displays the instances currently attached to the bucket, if any.
-
Choose Attach instance to attach an instance to the bucket.
-
In the Select an instance dropdown menu, select the instance that you want to attach to the bucket.
Note
You can attach instances that are in a running or stopped state only. Additionally, you can attach only instances that are in the same AWS Region as the bucket.
-
Choose Attach to attach the instance. Otherwise, choose Cancel.
The instance has full access to the bucket and its objects after it's attached. You can configure software or a plugin on your instance to programmatically upload and access files on your bucket. For example, if you want to configure a WordPress instance to store media files on a bucket. For more information, see Tutorial: Connect a bucket to your WordPress instance.