Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added the backend configuration for the terraform #636

Merged
merged 1 commit into from
Jul 18, 2023

Conversation

athiruma
Copy link
Collaborator

@athiruma athiruma commented Jul 13, 2023

Changed the env.conf to env.sh to export the variables from local env.
Added the terraform backend to s3

Why?

terraform s3 backend configuration gives us the flexibility of storing the state file in s3_bucket. If further runs happen, it will directly restore the state file from s3 and made changes to the current state.

Pros

No need to manage the terraform state file.

@athiruma athiruma added documentation Improvements or additions to documentation ok-to-test PR ok to test labels Jul 13, 2023
@athiruma athiruma self-assigned this Jul 13, 2023
@@ -28,7 +28,7 @@ def lambda_handler(event, context):
index_id = f"{account}-{current_date}"
es_data = es_operations.get_es_data_by_id(index_id)
if es_data:
email_body += f"<h2>{es_data.get('_source', {}).get('subject')}</h2>"
email_body += f"<h2>Cloud Report: Long running instances in the @{account} account</h2>"
Copy link
Member

Choose a reason for hiding this comment

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

This should be Weekly Cloud Report: Long running instances in the Perf&Scale AWS Accounts
Per line https://github.com/redhat-performance/cloud-governance/blob/main/cloudsensei/agg_lambda/lambda_function.py#L25

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Mentioned in the Subject, I think no need for every account.

Copy link
Member

Choose a reason for hiding this comment

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

Will this be a daily or weekly report?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

weekly report.

Copy link
Member

@krishvoor krishvoor Jul 14, 2023

Choose a reason for hiding this comment

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

Alright, lgtm

@athiruma athiruma force-pushed the add_backend_toterraform branch 4 times, most recently from 0298df9 to fa73f90 Compare July 14, 2023 07:28
Copy link
Member

@krishvoor krishvoor left a comment

Choose a reason for hiding this comment

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

/lgtm

Copy link
Collaborator Author

@athiruma athiruma left a comment

Choose a reason for hiding this comment

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

@krishvoor some changes are added.
i.e env. conf to env.sh
ptlk

Copy link
Collaborator

@ebattat ebattat left a comment

Choose a reason for hiding this comment

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

@athiruma, did you add rule against bucket to store data up to 3 monthes, otherwise we will pay on old data?

@athiruma
Copy link
Collaborator Author

@athiruma, did you add rule against bucket to store data up to 3 monthes, otherwise we will pay on old data?

I am using the cloud-governance s3 bucket.

@ebattat
Copy link
Collaborator

ebattat commented Jul 16, 2023

@athiruma I think we should add deletion rule for this bucket, what do you think keep only last 3 months ?

@athiruma
Copy link
Collaborator Author

@athiruma I think we should add deletion rule for this bucket, what do you think keep only last 3 months ?

We can implement a lifecycle policy for the cloud-governance bucket. So it will move the data to s3 glacier after 3 months. WDYT?

@ebattat
Copy link
Collaborator

ebattat commented Jul 16, 2023

Why do you think we need this data in s3 glacier ?

@athiruma
Copy link
Collaborator Author

Why do you think we need this data in s3 glacier ?

It is used for databackup.

@ebattat
Copy link
Collaborator

ebattat commented Jul 16, 2023

@athiruma Ok lets do it, pls let me know if you need my help

@krishvoor
Copy link
Member

Why do you think we need this data in s3 glacier ?

It is used for databackup.

@athiruma I assume, we will store Terraform state file change in the S3 bucket,
why would we need to retain it beyond 3 months?

@athiruma
Copy link
Collaborator Author

Why do you think we need this data in s3 glacier ?

It is used for databackup.

@athiruma I assume, we will store Terraform state file change in the S3 bucket, why would we need to retain it beyond 3 months?

@krishvoor We always need to retain the terraform state file until we delete the services.

Copy link
Collaborator

@ebattat ebattat left a comment

Choose a reason for hiding this comment

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

/LGTM - Let me know when you add the s3 rule so I will merge it

@athiruma
Copy link
Collaborator Author

/LGTM - Let me know when you add the s3 rule so I will merge it

Added, waiting for the @krishvoor reply and approval.

@krishvoor
Copy link
Member

/LGTM - Let me know when you add the s3 rule so I will merge it

Added, waiting for the @krishvoor reply and approval.

/lgtm

@ebattat
Copy link
Collaborator

ebattat commented Jul 18, 2023

krishvoor

Next time please approve it from the review changes window
image

Copy link
Member

@krishvoor krishvoor left a comment

Choose a reason for hiding this comment

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

/LGTM

@ebattat ebattat merged commit 114f3fb into redhat-performance:main Jul 18, 2023
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation ok-to-test PR ok to test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants