Skip to content

feat: aws package, so builder and signet_node are isolated to k8s resources #4

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

Open
wants to merge 1 commit into
base: swanny/utils-are-dry
Choose a base branch
from

Conversation

rswanson
Copy link
Member

No description provided.

@rswanson rswanson mentioned this pull request May 20, 2025
Copy link
Member Author

rswanson commented May 20, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@rswanson rswanson marked this pull request as ready for review May 20, 2025 21:09
@rswanson rswanson requested a review from Copilot May 20, 2025 21:10
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR extracts AWS IAM/KMS resource management out of the builder package into a dedicated pkg/aws module, removing inline IAM/KMS types and creation logic from pkg/builder and adding shared types, factory functions, and tests under pkg/aws.

  • Removed inline IAM/KMS types, helpers, and tests from pkg/builder
  • Added pkg/aws/types.go with policy document definitions
  • Introduced pkg/aws/iam.go with CreateIAMResources and CreateKMSPolicy, plus one unit test

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pkg/builder/types.go Removed AWS IAM imports and type definitions
pkg/builder/helpers.go Deleted CreateKMSPolicy helper
pkg/builder/helpers_test.go Removed now-obsolete KMS policy unit tests
pkg/builder/builder.go Stripped out IAM role/policy creation code
pkg/aws/types.go Added shared IAM/KMS policy type definitions
pkg/aws/iam.go New AWS IAM/KMS resource factory functions
pkg/aws/iam_test.go Added test for KMS policy creation
Comments suppressed due to low confidence (2)

pkg/builder/builder.go:38

  • IAM resource creation was removed from NewBuilder but no new call to aws.CreateIAMResources was added, so the component no longer provisions required IAM roles and policies. Consider invoking CreateIAMResources and integrating its outputs into the builder component.
// Create ConfigMap for environment variables

pkg/aws/iam.go:19

  • CreateIAMResources is not covered by any unit tests. Consider adding tests to validate IAM role creation, policy generation, and attachment logic.
func CreateIAMResources(

PolicyAttachment *iam.RolePolicyAttachment
}

// CreateIAMResources creates IAM resources (role, policy, and policy attachment) for a component
Copy link
Preview

Copilot AI May 20, 2025

Choose a reason for hiding this comment

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

Exported function CreateIAMResources lacks a top-level doc comment. Please add a comment describing its purpose, parameters, and return values to improve API discoverability.

Suggested change
// CreateIAMResources creates IAM resources (role, policy, and policy attachment) for a component
// CreateIAMResources creates AWS IAM resources (role, policy, and policy attachment) for a component.
//
// Parameters:
// - ctx: The Pulumi context used for resource creation.
// - name: A unique name for the IAM resources.
// - serviceName: The name of the service that will use the IAM role.
// - keyArn: The ARN of the KMS key to include in the policy.
// - parent: The parent Pulumi resource for organizational purposes.
//
// Returns:
// - *IAMResources: A struct containing the created IAM role, policy, and policy attachment.
// - error: An error if any of the resource creation steps fail.

Copilot uses AI. Check for mistakes.

@@ -0,0 +1,34 @@
package aws
Copy link
Preview

Copilot AI May 20, 2025

Choose a reason for hiding this comment

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

[nitpick] Exported types IAMStatement, IAMPolicy, KMSStatement, and KMSPolicy lack documentation. Consider adding type-level comments to clarify their structure and intended usage.

Copilot uses AI. Check for mistakes.

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.

1 participant