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

Modernization of SG Account Starter #3

Merged
merged 45 commits into from
May 12, 2022
Merged

Modernization of SG Account Starter #3

merged 45 commits into from
May 12, 2022

Conversation

wesleykirklandsg
Copy link
Contributor

@wesleykirklandsg wesleykirklandsg merged commit c3e1d81 into main May 12, 2022
@wesleykirklandsg wesleykirklandsg deleted the Moderization branch May 12, 2022 14:25
Copy link

@rchildress87 rchildress87 left a comment

Choose a reason for hiding this comment

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

Some questions, some suggestions. Not everything is an action item 😉

.config/.terraform-docs.yml Show resolved Hide resolved
.config/.terraform-docs.yml Show resolved Hide resolved
## Centralized Logging

This repo is fully configured to allow for centralized logging with S3 and it's controlled via a few variables. To enable centralized logging set the following variables `log_archive_retention`, `aws_org_id`, `s3_destination_bucket_name`, `logging_account_id` to their required values and uncomment this block in `s3-bucket-logging.tf`.
If the apply file you're doing is for the log archive account these vars should be modified `enable_centralized_logging`, `log_archive_account` in addition to the prior variables with the proper values set.

Choose a reason for hiding this comment

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

typo

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What typo? I can't find anything.


## StratusGrid Standards we assume

- All resource names and name tags shall use `_` and not `-`s

Choose a reason for hiding this comment

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

Are you sure you want to use underscores in name tags? I believe AWS API uses hyphens or camel case when generating these sorts of things and no value is provided . I've typically used underscores for all HCL and then used hyphens for the names and name tags.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This doc states that AWS will basically let you do anything in the tag. From what I've learned over the years though the _ is the common replacement character for spaces. Most Tags would be PascalCase.

https://docs.aws.amazon.com/mediaconnect/latest/ug/tagging-restrictions.html

.config/.terraform-docs.yml Show resolved Hide resolved
provider.tf Show resolved Hide resolved
/* source = "StratusGrid/cloudtrail/aws"
version = "~> 3.0" */

source = "github.com/StratusGrid/terraform-aws-cloudtrail.git?ref=aws4.x"

Choose a reason for hiding this comment

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

Why are you using github instead of a Registry release?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because I screwed up See here

providers = {
aws = aws.us-east-1
}

# Uncomment the below if you wish to enable centralized logging to S3

Choose a reason for hiding this comment

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

Have you considered using conditional expressions with null instead of comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did and we talked about this. The problem with it is the mass amount of code duplication doesn't make sense, and modules don't take dynamics. I'm welcome to other ideas though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok I see what you mean now, I tried it and it won't work due to a count statement on the backend.

iam_role_s3_replication_arn needs to evaluate and is indexed and TF is trying to validate the index even though it won't be used. This is a product limitation.

  enable_centralized_logging = var.enable_centralized_logging == true ? true : false
  s3_destination_bucket_name = var.enable_centralized_logging == true ? var.s3_destination_bucket_name : ""
  iam_role_s3_replication_arn = var.enable_centralized_logging == false ? "" : module.iam_role_s3[0].iam_role_arn
  logging_account_id = var.enable_centralized_logging == true ? var.logging_account_id : ""

s3-centralized-logging.tf Show resolved Hide resolved
sns-topics.tf Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants