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

Novekm/add initial module code #1

Merged
merged 17 commits into from
Jul 15, 2024
Merged

Novekm/add initial module code #1

merged 17 commits into from
Jul 15, 2024

Conversation

novekm
Copy link
Collaborator

@novekm novekm commented Jul 13, 2024

All tests are passing, module is ready for initial release:

==========================================================================
TASK LOGS START
===========================================================================
Pre-entrypoint helper found
Executing Pre-Entrypoint Helpers
Pre-entrypoint helper loaded
Starting Static Tests

Initializing the backend...
Initializing modules...

Initializing provider plugins...
- Reusing previous version of hashicorp/awscc from the dependency lock file
- Reusing previous version of hashicorp/random from the dependency lock file
- Reusing previous version of hashicorp/null from the dependency lock file
- Reusing previous version of hashicorp/archive from the dependency lock file
- Reusing previous version of hashicorp/aws from the dependency lock file
- Using previously-installed hashicorp/awscc v1.5.0
- Using previously-installed hashicorp/random v3.6.2
- Using previously-installed hashicorp/null v3.2.2
- Using previously-installed hashicorp/archive v2.4.2
- Using previously-installed hashicorp/aws v5.58.0

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
Success! The configuration is valid.

Success - Terraform validate
Starting tflint
Installing `aws` plugin...
Installed `aws` (source: github.com/terraform-linters/tflint-ruleset-aws, version: 0.22.1)
Success - tflint found no linting issues!
Starting tfsec

======================================================
tfsec is joining the Trivy family

tfsec will continue to remain available 
for the time being, although our engineering 
attention will be directed at Trivy going forward.

You can read more here: 
https://github.com/aquasecurity/tfsec/discussions/1994
======================================================
Success - tfsec found no security issues!
  timings
  ──────────────────────────────────────────
  disk i/o             697.916µs
  parsing              26.633832ms
  adaptation           17.813542ms
  checks               26.023708ms
  total                71.168998ms

  counts
  ──────────────────────────────────────────
  modules downloaded   0
  modules processed    1
  blocks processed     116
  files read           5

  results
  ──────────────────────────────────────────
  passed               17
  ignored              80
  critical             0
  high                 0
  medium               0
  low                  0


No problems detected!


Running Checkov Analysis
terraform scan results:

Passed checks: 176, Failed checks: 0, Skipped checks: 0


Success - Checkov found no issues!
Starting markdown lint
Success - markdown lint found no linting issues!
Starting terraform-docs
Success - Terraform Docs creation verified!
End of Static Tests
Static test completed
Post-entrypoint helper found
Executing Post-Entrypoint Helpers
Post-entrypoint helper loaded
===========================================================================
TASK LOGS END
===========================================================================

Copy link

Hi there,

I am commenting because your project has not yet been published and you have opened a pr to the main branch.
If we proceed with reviewing this pr and it is merged this will result in the publication of your project. If you are
not ready to publish yet, we recommend you close this PR and develop against a different branch.
Once you are ready to publish you can open a PR from that branch to main.

If you are ready to publish, please issue the following comment on this PR and I will initiate the publication review
process:

/confirm-publication

If you require more information please reach out to your AWS PoC who is assisting you with this project.

@novekm
Copy link
Collaborator Author

novekm commented Jul 13, 2024

/confirm-publication

Copy link

@aws-ia-automator-prod aws-ia-automator-prod bot left a comment

Choose a reason for hiding this comment

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

Review has been requested from required contributors, once they have approved I will remove my request for changes. When this PR is merged your project will be published

@novekm
Copy link
Collaborator Author

novekm commented Jul 13, 2024

/do-e2e-tests

Copy link

End to end test has been scheduled

Copy link

E2E tests in progress

Copy link

@aws-ia-automator-prod aws-ia-automator-prod bot left a comment

Choose a reason for hiding this comment

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

E2E test has completed with errors. If you are an external contributor, please contact the project maintainers for more information.

@novekm
Copy link
Collaborator Author

novekm commented Jul 13, 2024

/do-e2e-tests

Copy link

End to end test has been scheduled

Copy link

E2E tests in progress

Copy link

@aws-ia-automator-prod aws-ia-automator-prod bot left a comment

Choose a reason for hiding this comment

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

E2E tests completed successfully

@novekm
Copy link
Collaborator Author

novekm commented Jul 13, 2024

/do-e2e-tests

Copy link

End to end test has been scheduled

Copy link

E2E tests in progress

Copy link

@aws-ia-automator-prod aws-ia-automator-prod bot left a comment

Choose a reason for hiding this comment

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

E2E tests completed successfully

@novekm
Copy link
Collaborator Author

novekm commented Jul 14, 2024

/do-e2e-tests

1 similar comment
@novekm
Copy link
Collaborator Author

novekm commented Jul 14, 2024

/do-e2e-tests

Copy link

End to end test has been scheduled

Copy link
Collaborator

@wellsiau-aws wellsiau-aws left a comment

Choose a reason for hiding this comment

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

I see bunch of resources commented out, is this PR ready ?

@novekm
Copy link
Collaborator Author

novekm commented Jul 14, 2024

I see bunch of resources commented out, is this PR ready ?

@wellsiau-aws Yes, the resources commented out are related to this open (GitHub issue about the aws_s3_object resource](hashicorp/terraform-provider-aws#12652). I left the resources there so I can switch back easily once the issue is resolved. In long term I'd prefer to use the aws_s3_object resource instead of local-exec workaround. Removed the few commented out random_string resources

@novekm
Copy link
Collaborator Author

novekm commented Jul 14, 2024

/do-e2e-tests

Copy link

End to end test has been scheduled

Copy link

E2E tests in progress

Copy link

@aws-ia-automator-prod aws-ia-automator-prod bot left a comment

Choose a reason for hiding this comment

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

E2E test has completed with errors. If you are an external contributor, please contact the project maintainers for more information.

@novekm
Copy link
Collaborator Author

novekm commented Jul 14, 2024

/do-e2e-tests

Copy link

End to end test has been scheduled

Copy link

E2E tests in progress

Copy link

@aws-ia-automator-prod aws-ia-automator-prod bot left a comment

Choose a reason for hiding this comment

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

E2E test has completed with errors. If you are an external contributor, please contact the project maintainers for more information.

@novekm
Copy link
Collaborator Author

novekm commented Jul 14, 2024

E2E test has completed with errors. If you are an external contributor, please contact the project maintainers for more information.

Not sure why the pipeline test is having intermittent failure. Looking at logs I see this:

�[31m│�[0m �[0m�[1m�[31mError: �[0m�[0m�[1mreading S3 Bucket (streamlit-app-assets-7hmf) Object (streamlit-app-assets.zip): couldn't find resource�[0m
�[31m│�[0m �[0m
�[31m│�[0m �[0m�[0m  with module.serverless-streamlit-app.data.aws_s3_object.streamlit_assets,
�[31m│�[0m �[0m  on data.tf line 26, in data "aws_s3_object" "streamlit_assets":
�[31m│�[0m �[0m  26: data "aws_s3_object" "streamlit_assets" �[4m{�[0m�[0m
�[31m│�[0m �[0m
�[31m╵�[0m�[0m
�[0mtests/01_mandatory.tftest.hcl... �[31mfail�[0m�[0m
tests/02_existing_resources.tftest.hcl... �[37min progress�[0m
�[0mtests/02_existing_resources.tftest.hcl... �[37mtearing down�[0m
�[0mtests/02_existing_resources.tftest.hcl... �[32mpass�[0m�[0m

�[31mFailure!�[0m�[0m 1 passed, 1 failed.

For data "aws_s3_object" "streamlit_assets I have an explicit depends_on to not attempt to fetch the resource unless null_resource has provisioned successfully:

# Fetch details about S3 object
data "aws_s3_object" "streamlit_assets" {
  bucket = aws_s3_bucket.streamlit_s3_bucket.id
  key    = "${var.app_name}-assets.zip"

  depends_on = [
    # aws_s3_object.streamlit_assets,
    # Temporary workaround until this GitHub issue on aws_s3_object is resolved: https://github.com/hashicorp/terraform-provider-aws/issues/12652
    null_resource.put_s3_object
  ]
}

Even stranger, the local functional-test and all manual runs of terraform apply are consistently passing:

===========================================================================
TASK LOGS START
===========================================================================
Pre-entrypoint helper found
Executing Pre-Entrypoint Helpers
Pre-entrypoint helper loaded
Starting Functional Tests
File ./tests/01_mandatory.tftest.hcl is found, resuming test

Initializing the backend...
Initializing modules...

Initializing provider plugins...
- Reusing previous version of hashicorp/archive from the dependency lock file
- Reusing previous version of hashicorp/aws from the dependency lock file
- Reusing previous version of hashicorp/awscc from the dependency lock file
- Reusing previous version of hashicorp/random from the dependency lock file
- Reusing previous version of hashicorp/null from the dependency lock file
- Using previously-installed hashicorp/archive v2.4.2
- Using previously-installed hashicorp/aws v5.58.0
- Using previously-installed hashicorp/awscc v1.5.0
- Using previously-installed hashicorp/random v3.6.2
- Using previously-installed hashicorp/null v3.2.2

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
tests/01_mandatory.tftest.hcl... in progress
  run "unit_test"... pass
  run "e2e_test"... pass
tests/01_mandatory.tftest.hcl... tearing down
tests/01_mandatory.tftest.hcl... pass
tests/02_existing_resources.tftest.hcl... in progress
tests/02_existing_resources.tftest.hcl... tearing down
tests/02_existing_resources.tftest.hcl... pass

Success! 2 passed, 0 failed.
Terraform Test Successfull
End of Functional Tests
Functional test completed
Post-entrypoint helper found
Executing Post-Entrypoint Helpers
Post-entrypoint helper loaded
===========================================================================
TASK LOGS END
===========================================================================

Adding another explicit dependency for aws_s3_bucket.streamlit_s3_bucket and re-running pipeline test

@novekm
Copy link
Collaborator Author

novekm commented Jul 14, 2024

/do-e2e-tests

Copy link

End to end test has been scheduled

Copy link

E2E tests in progress

Copy link

@aws-ia-automator-prod aws-ia-automator-prod bot left a comment

Choose a reason for hiding this comment

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

E2E tests completed successfully

@novekm
Copy link
Collaborator Author

novekm commented Jul 14, 2024

Looks like E2E test passed, so hopefully that was it. Running one more to be safe.

@novekm
Copy link
Collaborator Author

novekm commented Jul 14, 2024

/do-e2e-tests

Copy link

End to end test has been scheduled

Copy link

E2E tests in progress

Copy link

@aws-ia-automator-prod aws-ia-automator-prod bot left a comment

Choose a reason for hiding this comment

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

E2E tests completed successfully

@novekm
Copy link
Collaborator Author

novekm commented Jul 15, 2024

Looks like issue with pipeline E2E test is resolved - any other changes that need to be made to the PR?

@tbulding tbulding self-requested a review July 15, 2024 14:32
@novekm novekm merged commit afd9db6 into aws-ia:main Jul 15, 2024
3 checks passed
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.

3 participants