aws_sdk_rds/types/_db_instance_role.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Information about an Amazon Web Services Identity and Access Management (IAM) role that is associated with a DB instance.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct DbInstanceRole {
7 /// <p>The Amazon Resource Name (ARN) of the IAM role that is associated with the DB instance.</p>
8 pub role_arn: ::std::option::Option<::std::string::String>,
9 /// <p>The name of the feature associated with the Amazon Web Services Identity and Access Management (IAM) role. For information about supported feature names, see <code>DBEngineVersion</code>.</p>
10 pub feature_name: ::std::option::Option<::std::string::String>,
11 /// <p>Information about the state of association between the IAM role and the DB instance. The Status property returns one of the following values:</p>
12 /// <ul>
13 /// <li>
14 /// <p><code>ACTIVE</code> - the IAM role ARN is associated with the DB instance and can be used to access other Amazon Web Services services on your behalf.</p></li>
15 /// <li>
16 /// <p><code>PENDING</code> - the IAM role ARN is being associated with the DB instance.</p></li>
17 /// <li>
18 /// <p><code>INVALID</code> - the IAM role ARN is associated with the DB instance, but the DB instance is unable to assume the IAM role in order to access other Amazon Web Services services on your behalf.</p></li>
19 /// </ul>
20 pub status: ::std::option::Option<::std::string::String>,
21}
22impl DbInstanceRole {
23 /// <p>The Amazon Resource Name (ARN) of the IAM role that is associated with the DB instance.</p>
24 pub fn role_arn(&self) -> ::std::option::Option<&str> {
25 self.role_arn.as_deref()
26 }
27 /// <p>The name of the feature associated with the Amazon Web Services Identity and Access Management (IAM) role. For information about supported feature names, see <code>DBEngineVersion</code>.</p>
28 pub fn feature_name(&self) -> ::std::option::Option<&str> {
29 self.feature_name.as_deref()
30 }
31 /// <p>Information about the state of association between the IAM role and the DB instance. The Status property returns one of the following values:</p>
32 /// <ul>
33 /// <li>
34 /// <p><code>ACTIVE</code> - the IAM role ARN is associated with the DB instance and can be used to access other Amazon Web Services services on your behalf.</p></li>
35 /// <li>
36 /// <p><code>PENDING</code> - the IAM role ARN is being associated with the DB instance.</p></li>
37 /// <li>
38 /// <p><code>INVALID</code> - the IAM role ARN is associated with the DB instance, but the DB instance is unable to assume the IAM role in order to access other Amazon Web Services services on your behalf.</p></li>
39 /// </ul>
40 pub fn status(&self) -> ::std::option::Option<&str> {
41 self.status.as_deref()
42 }
43}
44impl DbInstanceRole {
45 /// Creates a new builder-style object to manufacture [`DbInstanceRole`](crate::types::DbInstanceRole).
46 pub fn builder() -> crate::types::builders::DbInstanceRoleBuilder {
47 crate::types::builders::DbInstanceRoleBuilder::default()
48 }
49}
50
51/// A builder for [`DbInstanceRole`](crate::types::DbInstanceRole).
52#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
53#[non_exhaustive]
54pub struct DbInstanceRoleBuilder {
55 pub(crate) role_arn: ::std::option::Option<::std::string::String>,
56 pub(crate) feature_name: ::std::option::Option<::std::string::String>,
57 pub(crate) status: ::std::option::Option<::std::string::String>,
58}
59impl DbInstanceRoleBuilder {
60 /// <p>The Amazon Resource Name (ARN) of the IAM role that is associated with the DB instance.</p>
61 pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62 self.role_arn = ::std::option::Option::Some(input.into());
63 self
64 }
65 /// <p>The Amazon Resource Name (ARN) of the IAM role that is associated with the DB instance.</p>
66 pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67 self.role_arn = input;
68 self
69 }
70 /// <p>The Amazon Resource Name (ARN) of the IAM role that is associated with the DB instance.</p>
71 pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
72 &self.role_arn
73 }
74 /// <p>The name of the feature associated with the Amazon Web Services Identity and Access Management (IAM) role. For information about supported feature names, see <code>DBEngineVersion</code>.</p>
75 pub fn feature_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
76 self.feature_name = ::std::option::Option::Some(input.into());
77 self
78 }
79 /// <p>The name of the feature associated with the Amazon Web Services Identity and Access Management (IAM) role. For information about supported feature names, see <code>DBEngineVersion</code>.</p>
80 pub fn set_feature_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
81 self.feature_name = input;
82 self
83 }
84 /// <p>The name of the feature associated with the Amazon Web Services Identity and Access Management (IAM) role. For information about supported feature names, see <code>DBEngineVersion</code>.</p>
85 pub fn get_feature_name(&self) -> &::std::option::Option<::std::string::String> {
86 &self.feature_name
87 }
88 /// <p>Information about the state of association between the IAM role and the DB instance. The Status property returns one of the following values:</p>
89 /// <ul>
90 /// <li>
91 /// <p><code>ACTIVE</code> - the IAM role ARN is associated with the DB instance and can be used to access other Amazon Web Services services on your behalf.</p></li>
92 /// <li>
93 /// <p><code>PENDING</code> - the IAM role ARN is being associated with the DB instance.</p></li>
94 /// <li>
95 /// <p><code>INVALID</code> - the IAM role ARN is associated with the DB instance, but the DB instance is unable to assume the IAM role in order to access other Amazon Web Services services on your behalf.</p></li>
96 /// </ul>
97 pub fn status(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
98 self.status = ::std::option::Option::Some(input.into());
99 self
100 }
101 /// <p>Information about the state of association between the IAM role and the DB instance. The Status property returns one of the following values:</p>
102 /// <ul>
103 /// <li>
104 /// <p><code>ACTIVE</code> - the IAM role ARN is associated with the DB instance and can be used to access other Amazon Web Services services on your behalf.</p></li>
105 /// <li>
106 /// <p><code>PENDING</code> - the IAM role ARN is being associated with the DB instance.</p></li>
107 /// <li>
108 /// <p><code>INVALID</code> - the IAM role ARN is associated with the DB instance, but the DB instance is unable to assume the IAM role in order to access other Amazon Web Services services on your behalf.</p></li>
109 /// </ul>
110 pub fn set_status(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
111 self.status = input;
112 self
113 }
114 /// <p>Information about the state of association between the IAM role and the DB instance. The Status property returns one of the following values:</p>
115 /// <ul>
116 /// <li>
117 /// <p><code>ACTIVE</code> - the IAM role ARN is associated with the DB instance and can be used to access other Amazon Web Services services on your behalf.</p></li>
118 /// <li>
119 /// <p><code>PENDING</code> - the IAM role ARN is being associated with the DB instance.</p></li>
120 /// <li>
121 /// <p><code>INVALID</code> - the IAM role ARN is associated with the DB instance, but the DB instance is unable to assume the IAM role in order to access other Amazon Web Services services on your behalf.</p></li>
122 /// </ul>
123 pub fn get_status(&self) -> &::std::option::Option<::std::string::String> {
124 &self.status
125 }
126 /// Consumes the builder and constructs a [`DbInstanceRole`](crate::types::DbInstanceRole).
127 pub fn build(self) -> crate::types::DbInstanceRole {
128 crate::types::DbInstanceRole {
129 role_arn: self.role_arn,
130 feature_name: self.feature_name,
131 status: self.status,
132 }
133 }
134}