Skip to content

Commit d9b5c8d

Browse files
author
Leon Michalski
committed
fix variable name
1 parent bdcbd19 commit d9b5c8d

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

v2/guide/constructs.adoc

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ Some of our language-specific API references currently have errors in the paths
661661
====
662662
663663
[#constructs-l1-l2-references]
664-
=== Passing construct references to L1 properties
664+
==== Passing construct references to L1 properties
665665
666666
L1 constructs support passing construct objects directly to properties that expect resource references, such as ARNs or names. The CDK automatically resolves the appropriate attribute (ARN, name, or other identifier) based on the property type.
667667
@@ -673,7 +673,7 @@ TypeScript::
673673
+
674674
[source,javascript,subs="verbatim,attributes"]
675675
----
676-
const l2Role = new iam.Role(this, 'L2Role', {
676+
const role = new iam.Role(this, 'MyRole', {
677677
assumedBy: new iam.ServicePrincipal('lambda.amazonaws.com'),
678678
managedPolicies: [
679679
iam.ManagedPolicy.fromAwsManagedPolicyName(
@@ -684,7 +684,7 @@ const l2Role = new iam.Role(this, 'L2Role', {
684684

685685
new lambda.CfnFunction(this, "HelloWorldFunction", {
686686
runtime: 'nodejs24.x',
687-
role: l2Role, // Pass L2 construct directly
687+
role: role, // Pass construct directly
688688
handler: 'index.handler',
689689
code: {
690690
zipFile: `
@@ -702,7 +702,7 @@ JavaScript::
702702
+
703703
[source,javascript,subs="verbatim,attributes"]
704704
----
705-
const l2Role = new iam.Role(this, 'L2Role', {
705+
const role = new iam.Role(this, 'MyRole', {
706706
assumedBy: new iam.ServicePrincipal('lambda.amazonaws.com'),
707707
managedPolicies: [
708708
iam.ManagedPolicy.fromAwsManagedPolicyName(
@@ -713,7 +713,7 @@ const l2Role = new iam.Role(this, 'L2Role', {
713713

714714
new lambda.CfnFunction(this, "HelloWorldFunction", {
715715
runtime: 'nodejs24.x',
716-
role: l2Role, // Pass L2 construct directly
716+
role: role, // Pass construct directly
717717
handler: 'index.handler',
718718
code: {
719719
zipFile: `
@@ -731,7 +731,7 @@ Python::
731731
+
732732
[source,python,subs="verbatim,attributes"]
733733
----
734-
l2_role = iam.Role(self, "L2Role",
734+
role = iam.Role(self, "MyRole",
735735
assumed_by=iam.ServicePrincipal("lambda.amazonaws.com"),
736736
managed_policies=[
737737
iam.ManagedPolicy.from_aws_managed_policy_name(
@@ -742,7 +742,7 @@ l2_role = iam.Role(self, "L2Role",
742742

743743
lambda_.CfnFunction(self, "HelloWorldFunction",
744744
runtime="nodejs24.x",
745-
role=l2_role, # Pass L2 construct directly
745+
role=role, # Pass construct directly
746746
handler="index.handler",
747747
code=lambda_.CfnFunction.CodeProperty(
748748
zip_file=
@@ -762,7 +762,7 @@ Java::
762762
+
763763
[source,java,subs="verbatim,attributes"]
764764
----
765-
Role l2Role = Role.Builder.create(this, "L2Role")
765+
Role role = Role.Builder.create(this, "MyRole")
766766
.assumedBy(new ServicePrincipal("lambda.amazonaws.com"))
767767
.managedPolicies(Arrays.asList(
768768
ManagedPolicy.fromAwsManagedPolicyName(
@@ -773,7 +773,7 @@ Role l2Role = Role.Builder.create(this, "L2Role")
773773

774774
CfnFunction.Builder.create(this, "HelloWorldFunction")
775775
.runtime("nodejs24.x")
776-
.role(l2Role) // Pass L2 construct directly
776+
.role(role) // Pass construct directly
777777
.handler("index.handler")
778778
.code(CfnFunction.CodeProperty.builder()
779779
.zipFile(
@@ -791,7 +791,7 @@ C#::
791791
+
792792
[source,csharp,subs="verbatim,attributes"]
793793
----
794-
var l2Role = new Role(this, "L2Role", new RoleProps
794+
var role = new Role(this, "MyRole", new RoleProps
795795
{
796796
AssumedBy = new ServicePrincipal("lambda.amazonaws.com"),
797797
ManagedPolicies = new[]
@@ -805,7 +805,7 @@ var l2Role = new Role(this, "L2Role", new RoleProps
805805
new CfnFunction(this, "HelloWorldFunction", new CfnFunctionProps
806806
{
807807
Runtime = "nodejs24.x",
808-
Role = l2Role, // Pass L2 construct directly
808+
Role = role, // Pass construct directly
809809
Handler = "index.handler",
810810
Code = new CfnFunction.CodeProperty
811811
{

0 commit comments

Comments
 (0)