Skip to content

Complete S3 storage deployment and IAM policy configuration for Grafana backups#24

Open
leoleiden wants to merge 1 commit into
mate-academy:mainfrom
leoleiden:main
Open

Complete S3 storage deployment and IAM policy configuration for Grafana backups#24
leoleiden wants to merge 1 commit into
mate-academy:mainfrom
leoleiden:main

Conversation

@leoleiden

Copy link
Copy Markdown

Overview

Successfully deployed an AWS S3 bucket and configured the necessary IAM bucket policies to allow secure, credential-less access from the existing Grafana EC2 instance. All automated tests passed successfully.

Modifications & Troubleshooting

  • S3 Bucket & Policy Configuration (main.tf & terraform.tfvars): Deployed a new S3 bucket (mate-grafana-backups-760583) for storing Grafana backups. Implemented an aws_s3_bucket_policy using an aws_iam_policy_document to grant s3:ListBucket, s3:GetObject, and s3:PutObject permissions explicitly to the Grafana IAM role (grafana-role) created in the previous task.
  • Security Group Adjustment (AWS Console): Encountered a Connection timed out error when attempting to SSH into the EC2 instance for testing. Diagnosed this as a firewall restriction and resolved it by updating the instance's Security Group inbound rules to explicitly allow SSH (Port 22) traffic.

Result

Successfully SSH'd into the instance and verified the IAM permissions natively. Downloaded a test video via wget and securely uploaded it to the S3 bucket using aws s3 cp without requiring explicit AWS credentials, proving the instance profile and bucket policies are working perfectly. The screenshot demonstrating the successful upload is included in the repository.

@leoleiden

Copy link
Copy Markdown
Author
aws6_3 aws6_2 aws6_1

@leoleiden

Copy link
Copy Markdown
Author
s3-upload-success

@Losiev Losiev left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done!👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants