public MyStack() { var role = new Aws.Iam.Role("role", new Aws.Iam.RoleArgs { AssumeRolePolicy = @"{ ""Version"": ""2012-10-17"", ""Statement"": [ { ""Action"": ""sts:AssumeRole"", ""Principal"": { ""Service"": ""config.amazonaws.com"" }, ""Effect"": ""Allow"", ""Sid"": """" } ] } ", }); var foo = new Aws.Cfg.Recorder("foo", new Aws.Cfg.RecorderArgs { RoleArn = role.Arn, }); }
public MyStack() { var exampleRecorder = new Aws.Cfg.Recorder("exampleRecorder", new Aws.Cfg.RecorderArgs { }); var exampleFunction = new Aws.Lambda.Function("exampleFunction", new Aws.Lambda.FunctionArgs { }); var examplePermission = new Aws.Lambda.Permission("examplePermission", new Aws.Lambda.PermissionArgs { Action = "lambda:InvokeFunction", Function = exampleFunction.Arn, Principal = "config.amazonaws.com", }); var exampleRule = new Aws.Cfg.Rule("exampleRule", new Aws.Cfg.RuleArgs { Source = new Aws.Cfg.Inputs.RuleSourceArgs { Owner = "CUSTOM_LAMBDA", SourceIdentifier = exampleFunction.Arn, }, }, new CustomResourceOptions { DependsOn = { "aws_config_configuration_recorder.example", "aws_lambda_permission.example", }, }); }
public MyStack() { var rule = new Aws.Cfg.Rule("rule", new Aws.Cfg.RuleArgs { Source = new Aws.Cfg.Inputs.RuleSourceArgs { Owner = "AWS", SourceIdentifier = "S3_BUCKET_VERSIONING_ENABLED", }, }, new CustomResourceOptions { DependsOn = { "aws_config_configuration_recorder.foo", }, }); var role = new Aws.Iam.Role("role", new Aws.Iam.RoleArgs { AssumeRolePolicy = @"{ ""Version"": ""2012-10-17"", ""Statement"": [ { ""Action"": ""sts:AssumeRole"", ""Principal"": { ""Service"": ""config.amazonaws.com"" }, ""Effect"": ""Allow"", ""Sid"": """" } ] } ", }); var foo = new Aws.Cfg.Recorder("foo", new Aws.Cfg.RecorderArgs { RoleArn = role.Arn, }); var rolePolicy = new Aws.Iam.RolePolicy("rolePolicy", new Aws.Iam.RolePolicyArgs { Policy = @"{ ""Version"": ""2012-10-17"", ""Statement"": [ { ""Action"": ""config:Put*"", ""Effect"": ""Allow"", ""Resource"": ""*"" } ] } ", Role = role.Id, }); }
public MyStack() { var fooRecorderStatus = new Aws.Cfg.RecorderStatus("fooRecorderStatus", new Aws.Cfg.RecorderStatusArgs { IsEnabled = true, }, new CustomResourceOptions { DependsOn = { "aws_config_delivery_channel.foo", }, }); var role = new Aws.Iam.Role("role", new Aws.Iam.RoleArgs { AssumeRolePolicy = @"{ ""Version"": ""2012-10-17"", ""Statement"": [ { ""Action"": ""sts:AssumeRole"", ""Principal"": { ""Service"": ""config.amazonaws.com"" }, ""Effect"": ""Allow"", ""Sid"": """" } ] } ", }); var rolePolicyAttachment = new Aws.Iam.RolePolicyAttachment("rolePolicyAttachment", new Aws.Iam.RolePolicyAttachmentArgs { PolicyArn = "arn:aws:iam::aws:policy/service-role/AWSConfigRole", Role = role.Name, }); var bucket = new Aws.S3.Bucket("bucket", new Aws.S3.BucketArgs { }); var fooDeliveryChannel = new Aws.Cfg.DeliveryChannel("fooDeliveryChannel", new Aws.Cfg.DeliveryChannelArgs { S3BucketName = bucket.BucketName, }); var fooRecorder = new Aws.Cfg.Recorder("fooRecorder", new Aws.Cfg.RecorderArgs { RoleArn = role.Arn, }); var rolePolicy = new Aws.Iam.RolePolicy("rolePolicy", new Aws.Iam.RolePolicyArgs { Policy = Output.Tuple(bucket.Arn, bucket.Arn).Apply(values => { var bucketArn = values.Item1; var bucketArn1 = values.Item2; return(@$ "{{ " "Version" ": " "2012-10-17" ", " "Statement" ": [
public MyStack() { var bucket = new Aws.S3.Bucket("bucket", new Aws.S3.BucketArgs { ForceDestroy = true, }); var fooDeliveryChannel = new Aws.Cfg.DeliveryChannel("fooDeliveryChannel", new Aws.Cfg.DeliveryChannelArgs { S3BucketName = bucket.BucketName, }, new CustomResourceOptions { DependsOn = { "aws_config_configuration_recorder.foo", }, }); var role = new Aws.Iam.Role("role", new Aws.Iam.RoleArgs { AssumeRolePolicy = @"{ ""Version"": ""2012-10-17"", ""Statement"": [ { ""Action"": ""sts:AssumeRole"", ""Principal"": { ""Service"": ""config.amazonaws.com"" }, ""Effect"": ""Allow"", ""Sid"": """" } ] } ", }); var fooRecorder = new Aws.Cfg.Recorder("fooRecorder", new Aws.Cfg.RecorderArgs { RoleArn = role.Arn, }); var rolePolicy = new Aws.Iam.RolePolicy("rolePolicy", new Aws.Iam.RolePolicyArgs { Policy = Output.Tuple(bucket.Arn, bucket.Arn).Apply(values => { var bucketArn = values.Item1; var bucketArn1 = values.Item2; return(@$ "{{ " "Version" ": " "2012-10-17" ", " "Statement" ": [