AWS redshift documentation change
Summary
Added .NET SDK v4 code example for CreateCluster API including master user credentials handling
Security assessment
The change adds a code example demonstrating cluster creation with master username/password parameters, but does not address any specific security vulnerability or weakness. While credentials handling is security-sensitive, this is standard API usage documentation rather than security guidance or vulnerability mitigation.
Diff
diff --git a/redshift/latest/mgmt/example_redshift_CreateCluster_section.md b/redshift/latest/mgmt/example_redshift_CreateCluster_section.md index 696445696..66963ccb6 100644 --- a//redshift/latest/mgmt/example_redshift_CreateCluster_section.md +++ b//redshift/latest/mgmt/example_redshift_CreateCluster_section.md @@ -17,0 +18,59 @@ Action examples are code excerpts from larger programs and must be run in contex +.NET + + +**SDK for .NET (v4)** + + +###### Note + +There's more on GitHub. Find the complete example and learn how to set up and run in the [AWS Code Examples Repository](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/dotnetv4/Redshift#code-examples). + + + /// <summary> + /// Create a new Amazon Redshift cluster. + /// </summary> + /// <param name="clusterIdentifier">The identifier for the cluster.</param> + /// <param name="databaseName">The name of the database.</param> + /// <param name="masterUsername">The master username.</param> + /// <param name="masterUserPassword">The master user password.</param> + /// <param name="nodeType">The node type for the cluster.</param> + /// <returns>The cluster that was created.</returns> + public async Task<Cluster> CreateClusterAsync(string clusterIdentifier, string databaseName, + string masterUsername, string masterUserPassword, string nodeType = "ra3.large") + { + try + { + var request = new CreateClusterRequest + { + ClusterIdentifier = clusterIdentifier, + DBName = databaseName, + MasterUsername = masterUsername, + MasterUserPassword = masterUserPassword, + NodeType = nodeType, + NumberOfNodes = 1, + ClusterType = "single-node" + }; + + var response = await _redshiftClient.CreateClusterAsync(request); + Console.WriteLine($"Created cluster {clusterIdentifier}"); + return response.Cluster; + } + catch (ClusterAlreadyExistsException ex) + { + Console.WriteLine($"Cluster already exists: {ex.Message}"); + throw; + } + catch (Exception ex) + { + Console.WriteLine($"Couldn't create cluster. Here's why: {ex.Message}"); + throw; + } + } + + + + * For API details, see [CreateCluster](https://docs.aws.amazon.com/goto/DotNetSDKV4/redshift-2012-12-01/CreateCluster) in _AWS SDK for .NET API Reference_. + + + +