@fjall/components-infrastructure 2.27.0 → 2.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DEV_BOUNDARY_POLICY_NAME, DEV_DEPLOY_POLICY_NAME, DEV_PROVISIONER_POLICY_NAME, DEV_SYNC_WRITER_POLICY_NAME, SECURITY_TIER_TO_BOUNDARY, buildDevBoundaryStatements, buildDevDeployPolicyStatements, buildDevDeployTrustStatements, buildDevProvisionerPolicyStatements, buildDevProvisionerTrustStatements, buildDevSyncWriterPolicyStatements, buildDevSyncWriterTrustStatements, buildNarrowedDeployTrustStatements, deployBoundaryName, devDeployRoleName, devProvisionerRoleName, devSyncWriterRoleName } from "@fjall/generator";
|
|
1
|
+
import { DEV_BOUNDARY_POLICY_NAME, DEV_DEPLOY_POLICY_NAME, DEV_PROVISIONER_POLICY_NAME, DEV_SYNC_WRITER_POLICY_NAME, FJALL_OIDC_AUDIENCE, FJALL_OIDC_ISSUER_DOMAIN, FJALL_OIDC_PLACEHOLDER_THUMBPRINT, SECURITY_TIER_TO_BOUNDARY, buildDevBoundaryStatements, buildDevDeployPolicyStatements, buildDevDeployTrustStatements, buildDevProvisionerPolicyStatements, buildDevProvisionerTrustStatements, buildDevSyncWriterPolicyStatements, buildDevSyncWriterTrustStatements, buildNarrowedDeployTrustStatements, deployBoundaryName, devDeployRoleName, devProvisionerRoleName, devSyncWriterRoleName } from "@fjall/generator";
|
|
2
2
|
import { CfnOutput, Duration, Stack } from "aws-cdk-lib";
|
|
3
3
|
import * as iam from "aws-cdk-lib/aws-iam";
|
|
4
4
|
import { Runtime } from "aws-cdk-lib/aws-lambda";
|
|
@@ -19,8 +19,8 @@ import { CustomResource } from "../../resources/aws/utilities/customResource.js"
|
|
|
19
19
|
const OIDC_PROVIDER_HANDLER = `
|
|
20
20
|
const { IAMClient, ListOpenIDConnectProvidersCommand, GetOpenIDConnectProviderCommand, CreateOpenIDConnectProviderCommand, AddClientIDToOpenIDConnectProviderCommand } = require('@aws-sdk/client-iam');
|
|
21
21
|
|
|
22
|
-
const AUDIENCE = '
|
|
23
|
-
const THUMBPRINT = '
|
|
22
|
+
const AUDIENCE = '${FJALL_OIDC_AUDIENCE}';
|
|
23
|
+
const THUMBPRINT = '${FJALL_OIDC_PLACEHOLDER_THUMBPRINT}';
|
|
24
24
|
|
|
25
25
|
exports.handler = async (event) => {
|
|
26
26
|
const physicalId = event.PhysicalResourceId || event.LogicalResourceId;
|
|
@@ -71,7 +71,7 @@ export class OidcConnector extends Construct {
|
|
|
71
71
|
deployRoleArn;
|
|
72
72
|
constructor(scope, id, props) {
|
|
73
73
|
super(scope, id);
|
|
74
|
-
const issuerDomain =
|
|
74
|
+
const issuerDomain = FJALL_OIDC_ISSUER_DOMAIN;
|
|
75
75
|
const issuerUrl = `https://${issuerDomain}`;
|
|
76
76
|
const providerResource = new CustomResource(this, "OidcProvider", {
|
|
77
77
|
runtime: Runtime.NODEJS_22_X,
|
|
@@ -62,6 +62,9 @@ export class Account extends Stack {
|
|
|
62
62
|
const accountGlobalsConfigured = this.node.tryGetContext("fjallAccountGlobalsConfigured") === "true";
|
|
63
63
|
this.accountGlobalsConfigured = accountGlobalsConfigured;
|
|
64
64
|
const environment = config.environment ?? "unknown";
|
|
65
|
+
// Deploy-core mirrors this gate as synthCarriedOidcConnector
|
|
66
|
+
// (deploy-core/src/orchestration/contextHelpers.ts) to decide the
|
|
67
|
+
// post-deploy OIDC provider reconcile — keep the two in lockstep.
|
|
65
68
|
if (this.receivesDeployRole() &&
|
|
66
69
|
fjallOrgId &&
|
|
67
70
|
!oidcAlreadyConfigured &&
|
|
@@ -82,7 +82,10 @@ export function warnIfSnapshotUsernameAssumed(params) {
|
|
|
82
82
|
* warning surfaces this to anyone opting in.
|
|
83
83
|
*/
|
|
84
84
|
export function addMultiUserSecretRotation(params) {
|
|
85
|
-
const rotationPeriod = params.rotationConfig.automaticallyAfter ??
|
|
85
|
+
const rotationPeriod = params.rotationConfig.automaticallyAfter ??
|
|
86
|
+
(params.rotationConfig.automaticallyAfterDays !== undefined
|
|
87
|
+
? Duration.days(params.rotationConfig.automaticallyAfterDays)
|
|
88
|
+
: Duration.days(30));
|
|
86
89
|
const masterSecret = new Secret(params.scope, `${params.databaseName}MasterSecret`, {
|
|
87
90
|
secretName: ResourceNaming.masterSecretName(params.constructId)
|
|
88
91
|
});
|
|
@@ -45,6 +45,12 @@ export interface CredentialsConfig {
|
|
|
45
45
|
}
|
|
46
46
|
export interface SecretRotationConfig {
|
|
47
47
|
automaticallyAfter?: Duration;
|
|
48
|
+
/**
|
|
49
|
+
* Rotation period in whole days — the JSON-friendly form the generator
|
|
50
|
+
* scaffolds (`secretRotation: { automaticallyAfterDays: 30 }`). Ignored
|
|
51
|
+
* when `automaticallyAfter` is also set. Default: 30 days.
|
|
52
|
+
*/
|
|
53
|
+
automaticallyAfterDays?: number;
|
|
48
54
|
}
|
|
49
55
|
/**
|
|
50
56
|
* Resolve the opt-in rotation gate once at the construct boundary. Returns
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fjall/components-infrastructure",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.29.0",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
67
|
"@aws-sdk/client-organizations": "^3.1038.0",
|
|
68
|
-
"@fjall/generator": "^2.
|
|
69
|
-
"@fjall/util": "^2.
|
|
68
|
+
"@fjall/generator": "^2.29.0",
|
|
69
|
+
"@fjall/util": "^2.29.0",
|
|
70
70
|
"constructs": "^10.6.0"
|
|
71
71
|
},
|
|
72
72
|
"overrides": {
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
"engines": {
|
|
81
81
|
"node": ">=18.0.0"
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "c40ea0e1435400f3f42faaad5bcbf50e4400c1d4"
|
|
84
84
|
}
|